myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1420218 - in /myfaces/tomahawk/trunk: core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js core20/src/main/javascript/oam.custom.calendar/popcalendar.js
Date Tue, 11 Dec 2012 15:22:45 GMT
Author: werpu
Date: Tue Dec 11 15:22:39 2012
New Revision: 1420218

URL: http://svn.apache.org/viewvc?rev=1420218&view=rev
Log:
https://issues.apache.org/jira/browse/TOMAHAWK-1595

Modified:
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js
    myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.calendar/popcalendar.js

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js?rev=1420218&r1=1420217&r2=1420218&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js
(original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/popcalendar.js
Tue Dec 11 15:22:39 2012
@@ -1435,14 +1435,17 @@ org_apache_myfaces_PopupCalendar.prototy
             this.selectedDate.date = dateSelected.getDate();
             this.selectedDate.month = dateSelected.getMonth();
 
-            var yearStr = dateSelected.getYear() + "";
+            //https://issues.apache.org/jira/browse/TOMAHAWK-1595
+            //http://de.selfhtml.org/javascript/objekte/date.htm#get_year
+            var fullYear = dateSelected.getFullYear;
+            var yearDetermined = parseInt( ((fullYear) ? dateSelected.getFullYear(): dateSelected.getYear()),
10);
 
-            if (yearStr.length < 4)
+            if (!fullYear && yearDetermined < 1000)
             {
-                yearStr = (parseInt(yearStr, 10) + 1900) + "";
+                yearDetermined = yearDetermined + 1900;
             }
 
-            this.selectedDate.year = parseInt(yearStr, 10);
+            this.selectedDate.year = yearDetermined;
         }
         else
         {

Modified: myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.calendar/popcalendar.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.calendar/popcalendar.js?rev=1420218&r1=1420217&r2=1420218&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.calendar/popcalendar.js (original)
+++ myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.calendar/popcalendar.js Tue
Dec 11 15:22:39 2012
@@ -1454,14 +1454,17 @@ org_apache_myfaces_PopupCalendar.prototy
             this.selectedDate.date = dateSelected.getDate();
             this.selectedDate.month = dateSelected.getMonth();
 
-            var yearStr = dateSelected.getYear() + "";
+            //https://issues.apache.org/jira/browse/TOMAHAWK-1595
+            //http://de.selfhtml.org/javascript/objekte/date.htm#get_year
+            var fullYear = dateSelected.getFullYear;
+            var yearDetermined = parseInt( ((fullYear) ? dateSelected.getFullYear(): dateSelected.getYear()),
10);
 
-            if (yearStr.length < 4)
+            if (!fullYear && yearDetermined < 1000)
             {
-                yearStr = (parseInt(yearStr, 10) + 1900) + "";
+                yearDetermined = yearDetermined + 1900;
             }
 
-            this.selectedDate.year = parseInt(yearStr, 10);
+            this.selectedDate.year = yearDetermined;
         }
         else
         {



Mime
View raw message