Author: ivaynberg
Date: Thu Mar 18 15:18:15 2010
New Revision: 924856

URL: http://svn.apache.org/viewvc?rev=924856&view=rev
Log:
WICKET-2767 DatePicker Calendar: wrong year format when 4 digits are used 
(yyyy), e.g. 2010 --> 0010

Modified:
    
wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js

Modified: 
wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js?rev=924856&r1=924855&r2=924856&view=diff
==============================================================================
--- 
wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js
 (original)
+++ 
wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js
 Thu Mar 18 15:18:15 2010
@@ -134,7 +134,11 @@ Wicket.DateTime.substituteDate = functio
        // optionally do some padding to match the pattern
        if(datePattern.match(/dd+/)) day = Wicket.DateTime.padDateFragment(day);
        if(datePattern.match(/MM+/)) month = 
Wicket.DateTime.padDateFragment(month);
-       if(datePattern.match(/yy+/)) year = 
Wicket.DateTime.padDateFragment(year % 100);
+  if(datePattern.match(/yyy+/)) {
+    year = Wicket.DateTime.padDateFragment(year);
+  } else if(datePattern.match(/yy+/)) {
+    year = Wicket.DateTime.padDateFragment(year % 100);
+  }
        // replace pattern with real values
        return datePattern.replace(/d+/, day).replace(/M+/, 
month).replace(/y+/, year);
 }


Reply via email to