[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kjs
From:       Harri Porten <porten () kde ! org>
Date:       2006-09-30 16:46:09
Message-ID: 1159634769.929388.4047.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 590700 by porten:

revert JSC change back to old KRFCDate version. Fixes several regressions
in our Date.js test. Like the day value of

 new Date('Thu Nov 5 2065 18:15:30 GMT+0500')
 
Still need to investigate the reason for the floor() calls.


 M  +10 -0     date_object.cpp  


--- trunk/KDE/kdelibs/kjs/date_object.cpp #590699:590700
@@ -824,11 +824,21 @@
 
 static inline double ymdhmsToSeconds(long year, int mon, int day, int hour, int minute, int second)
 {
+    // in which case is the floor() needed? breaks day value of
+    // "new Date('Thu Nov 5 2065 18:15:30 GMT+0500')"
+#if 0
     double days = (day - 32075)
         + floor(1461 * (year + 4800.0 + (mon - 14) / 12) / 4)
         + 367 * (mon - 2 - (mon - 14) / 12 * 12) / 12
         - floor(3 * ((year + 4900.0 + (mon - 14) / 12) / 100) / 4)
         - 2440588;
+#else
+    double days = (day - 32075)
+            + 1461 * (year + 4800 + (mon - 14) / 12) / 4
+            + 367 * (mon - 2 - (mon - 14) / 12 * 12) / 12
+            - 3 * ((year + 4900 + (mon - 14) / 12) / 100) / 4
+            - 2440588;
+#endif
     return ((days * hoursPerDay + hour) * minutesPerHour + minute) * secondsPerMinute + second;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic