myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee-Wah Lee (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Created] (TRINIDAD-2266) DateConverter should keep hint consistent across server locales
Date Thu, 03 May 2012 23:00:48 GMT
Yee-Wah Lee created TRINIDAD-2266:
-------------------------------------

             Summary: DateConverter should keep hint consistent across server locales
                 Key: TRINIDAD-2266
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2266
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.0.1-core
            Reporter: Yee-Wah Lee
            Priority: Trivial


DateTimeConverter contains the following code for its default hint:
static{
 
   Calendar dateFactory = Calendar.getInstance();
    dateFactory.set(1998, 10, 29, 15, 45);
    _EXAMPLE_DATE = dateFactory.getTime();
}
The (arbitrary) date of 1998 was chosen as a recent date, but not the current date, so as
not to confuse users when the converter is used in conjunction with the validator. See comments
on revision 499114.

However, depending on the server locale, the Japanese Imperial or Thai Buddhist calendar may
be returned from Calendar.getInstance().  Calling set (Calendar.YEAR, 1998) would result in
a different date than the intended (Gregorian)1998 date. For example, Thai Calendar is offset
by 543 years, for example, so the resulting Date is equivalent to 1455 Gregorian. 

Suggest making the calendar instance specific to en_US, so that the example date's year is
always the locale-equivalent of (Gregorian) 1998.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message