Bugs item #1311848, was opened at 2005-10-03 14:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1311848&group_id=119783

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: extensions
Group: 1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Berriman (sberriman)
Assigned to: Nobody/Anonymous (nobody)
Summary: DatePickerSettings can choose wrong default date format.

Initial Comment:
The DatePickerSettings.getIfFormat(Locale) method bases
its choice of default date format string on language
alone (line 440), which doesn't work for browsers in,
for example, the UK, where the addition of the country
changes it.  The accompanying 'dateformats.properties'
also has a small error in it, in that it lists the
language 'en' twice; once with the UK format, and again
with US format.  (The 'uk' language in that file is
Ukraine, for readers who don't know there ISO codes.) 
Browsers in the US (or US browsers not changed from
their default...) report a language of 'en' and a
country of 'US'; whereas browsers in the UK (configured
correctly) report a language of 'en' and a country of
'GB' (ie. locale.toString() is "en_GB").

The problem arises if a DatePicker gets displayed in a
UK configured browser, whose target component's
underlying model is storing the value in a field of
type Date.  The date returned from the DatePicker is in
US format, which then fails convertion by the
DateConverter, which (correctly) picks up the UK locale.

To fix, line 440 needs to either read:

return dateformats.getProperty(locale.toString());

or else something like:

return
dateformats.getProperty(locale.getLanguage()+'-'+locale.getCountry());

if you want more control.

Then the 'dateformats.properties' keys need updating to
reflect the addition of the country code (and also
possibly the varient, if toString() is used.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1311848&group_id=119783


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to