GUI validation of i18n dates
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Russ_Pridemore
Posted On:   Wednesday, May 9, 2001 08:55 AM

I need to present a "mask" on a GUI screen representing a date in the current locale's short format, which may include a 4-digit year. How do I know which field is the year? I can get the localized pattern used by the DateFormat object, but the symbols seem to change based on the Locale!

Re: GUI validation of i18n dates

Posted By:   Anonymous  
Posted On:   Wednesday, May 30, 2001 12:41 PM

Use SimpleDateFormat.toPattern() to get the unlocalized pattern ( as opposed to toLocalizedPattern() ). The returned String uses the symbols referenced in the SimpleDateFormat documentation.


For an example of retrieving/changing this pattern, see How can I create a SHORT-style DateFormat with a four digit year that works for all locales?.

About | Sitemap | Contact