Fix week calculation.
authorJan Schneider <jan@horde.org>
Thu, 26 Mar 2009 17:54:48 +0000 (18:54 +0100)
committerJan Schneider <jan@horde.org>
Mon, 30 Mar 2009 16:53:40 +0000 (18:53 +0200)
kronolith/js/src/date.js

index 018946b..a8a7981 100644 (file)
             c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
             s = b - c;
             e = s + 1;
-            f = $d + ((153 * ($m - 3) + 2) / 5) + 58 + s;
+            f = $d + ((153 * ($m - 3) + 2) / 5 | 0) + 58 + s;
         }
         
         g = (a + b) % 7;
         d = (f + g - e) % 7;
-        n = (f + 3 - d) | 0;
+        n = f + 3 - d;
 
         if (n < 0) {
             w = 53 - ((g - s) / 5 | 0);
     $D.parseExact = function (s, fx) { 
         return $D.getParseFunction(fx)(s); 
     }; 
-}());
\ No newline at end of file
+}());