Bug 283881 - localize query url parameters
Summary: localize query url parameters
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.3   Edit
Assignee: Thomas Ehrnhoefer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2009-07-17 14:32 EDT by Steffen Pingel CLA
Modified: 2009-09-17 21:05 EDT (History)
0 users

See Also:


Attachments
patch v1 (14.00 KB, patch)
2009-09-17 13:05 EDT, Thomas Ehrnhoefer CLA
no flags Details | Diff
mylyn/context/zip (10.81 KB, application/octet-stream)
2009-09-17 13:05 EDT, Thomas Ehrnhoefer CLA
no flags Details
patch v2.1 (15.99 KB, patch)
2009-09-17 18:58 EDT, Thomas Ehrnhoefer CLA
no flags Details | Diff
mylyn/context/zip (40.63 KB, application/octet-stream)
2009-09-17 18:58 EDT, Thomas Ehrnhoefer CLA
no flags Details
patch v2.2 (16.13 KB, patch)
2009-09-17 19:08 EDT, Thomas Ehrnhoefer CLA
no flags Details | Diff
mylyn/context/zip (64.62 KB, application/octet-stream)
2009-09-17 19:08 EDT, Thomas Ehrnhoefer CLA
no flags Details
patch v3 (16.52 KB, patch)
2009-09-17 20:57 EDT, Thomas Ehrnhoefer CLA
no flags Details | Diff
mylyn/context/zip (11.19 KB, application/octet-stream)
2009-09-17 20:57 EDT, Thomas Ehrnhoefer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2009-07-17 14:32:55 EDT
Investigate if dates in FilterDefinitionConverter.addDateFilter() need to be formatted according to the server locale and date format. Current implementation:

 private static final String DATE_FORMAT = "d/MMM/yy"
 
 SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT, Locale.US);
Comment 1 Thomas Ehrnhoefer CLA 2009-09-16 17:44:24 EDT
We definitely need to localize that, as queries will fail.
The JiraUtil methods dateToString as well as stringToDate should be passed the locale, and calls like FilterDefinitionConverter.addDateFilter() should call the JiraUtil method and pass the locale (from the repository settings - user needs to configure)
Comment 2 Thomas Ehrnhoefer CLA 2009-09-17 13:05:14 EDT
Created attachment 147462 [details]
patch v1

* test case for query with localized date
* added a local field to FilterDefinitionConverter
* changed date conversion in JiraTaskDataHandler (Steffen, was that what you meant? not too sure about this one)
Comment 3 Thomas Ehrnhoefer CLA 2009-09-17 13:05:16 EDT
Created attachment 147463 [details]
mylyn/context/zip
Comment 4 Steffen Pingel CLA 2009-09-17 16:14:59 EDT
That looks good. Shouldn't we also be using the date format returned by JiraConfiguration.getDateFormat() in FilterDefinitionConverter?
Comment 5 Thomas Ehrnhoefer CLA 2009-09-17 16:45:49 EDT
sounds like a plan ;)
Comment 6 Thomas Ehrnhoefer CLA 2009-09-17 18:58:20 EDT
Created attachment 147506 [details]
patch v2.1

added dateFormat field
Comment 7 Thomas Ehrnhoefer CLA 2009-09-17 18:58:26 EDT
Created attachment 147507 [details]
mylyn/context/zip
Comment 8 Thomas Ehrnhoefer CLA 2009-09-17 19:08:32 EDT
Created attachment 147508 [details]
patch v2.2

same patch, but using DateFormat as parameter (not splitting locale and datePattern)
Comment 9 Thomas Ehrnhoefer CLA 2009-09-17 19:08:34 EDT
Created attachment 147509 [details]
mylyn/context/zip
Comment 10 Steffen Pingel CLA 2009-09-17 20:41:33 EDT
Great! Just one minor nit: The null check in FilterDefinitionConverter seems unnecessary, just add an Assert.isNull(...) in the constructor so we avoid duplicating the constant for the default format which is already in JiraConfiguration. 

Can you make that change and re-cut the patch? I currently get a conflict.
Comment 11 Thomas Ehrnhoefer CLA 2009-09-17 20:57:34 EDT
Created attachment 147513 [details]
patch v3

alright, I hope I didn't screw up while merging in the other patch that you committed :D
Comment 12 Thomas Ehrnhoefer CLA 2009-09-17 20:57:36 EDT
Created attachment 147514 [details]
mylyn/context/zip
Comment 13 Steffen Pingel CLA 2009-09-17 21:05:55 EDT
Great stuff. I have done some minor cleanup and applied the patch.