[
https://jira.jboss.org/jira/browse/RF-8136?page=com.atlassian.jira.plugin...
]
Francisco Jose Peredo Noguez commented on RF-8136:
--------------------------------------------------
The solution is simple, change the line 394 to:
var yy = parseInt(match[y],10); if (isNaN(yy)) return null; else if (yy<100) yy+=1900;
and the problem is solved (I simply removed the "else if (yy<70) yy+=2000;")
Richfaces.Calendar.parseDate using pattern "yyMMdd" is
incompatible with java.text.SimpleDateFormat
---------------------------------------------------------------------------------------------------
Key: RF-8136
URL:
https://jira.jboss.org/jira/browse/RF-8136
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.3.1
Reporter: Francisco Jose Peredo Noguez
I have a rich calendar configured with the pattern "yyMMdd"
If the user writes 600210 and the user clicks the little calendar button to show the
popup, he can see that the date has been translated to "February 10 of 2060" but
if he writes 700210 it is translated in to "February 10 of 1970". That is not
consistent the behavior of java.text.SimpleDateFormat.
The problem is at the file
3.3.1.GA\ui\calendar\src\main\resources\org\richfaces\renderkit\html\scripts\calendar.js
(line 394 of the file):
At the function Richfaces.Calendar.parseDate = function(dateString, pattern, monthNames,
monthNamesShort) method:
var yy = parseInt(match[y],10); if (isNaN(yy)) return null; else if (yy<70) yy+=2000;
else if (yy<100) yy+=1900;
That code translates the year in 600210 to 2060 when it should translate it to 1960 (to
be consistent with java.text.SimpleDateFormat behavior.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira