client-side DateFormat improperly parses year when format mask contains 3 or
more 'y'
-------------------------------------------------------------------------------------
Key: TRINIDAD-1821
URL: https://issues.apache.org/jira/browse/TRINIDAD-1821
Project: MyFaces Trinidad
Issue Type: Bug
Components: Components
Reporter: Cale Scholl
Priority: Minor
The following section of code was located in the _subparse function of
trinidad-impl DateFormat.js and was ripped out:
else if (charCount == 4)
{
// Bug 2169562: For four-digit year formats, reject
// three-year entries. Fair enough!
if (enteredChars == 3)
return false;
if (enteredChars <= 2)
year = _fix2DYear(year);
}
If a 4-digit format mask is specified for the year, it means full year format,
so any number is valid. Read the following:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
In particular:
"For parsing, if the number of pattern letters is more than 2, the year is
interpreted literally, regardless of the number of digits. So using the pattern
"MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D."
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.