]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Failing timezone unit tests #188
authorTim Wood <washwithcare@gmail.com>
Fri, 2 Mar 2012 00:19:41 +0000 (00:19 +0000)
committerTim Wood <washwithcare@gmail.com>
Fri, 2 Mar 2012 00:19:41 +0000 (00:19 +0000)
test/moment/format.js

index 13a6acf6ed6535bced29b65213f912c6be236888..97ecf01d91b7d6776d18325324d8dc6bdc88d4a0 100644 (file)
@@ -78,7 +78,11 @@ exports.format = {
         if (moment().zone() == 0) {
             test.ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero');
         }
-        test.ok(moment().zone() % 30 === 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
+        if (moment().zone() === 0) {
+           test.equal(moment().zone(), 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
+        } else {
+           test.equal(moment().zone() % 30, 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
+        }
         test.equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset');
         test.done();
     },