]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fixing tests where timezone is multiple of 15 and utc is wrong
authorTim Wood <washwithcare@gmail.com>
Fri, 4 May 2012 01:30:06 +0000 (18:30 -0700)
committerTim Wood <washwithcare@gmail.com>
Fri, 4 May 2012 01:30:06 +0000 (18:30 -0700)
test/moment/format.js
test/moment/utc.js

index 39e54b2a2cbe97e9be09d60499d290606ebdcfad..3f38173f81a2f0a64d6ba70b5cfefaaadb4558c4 100644 (file)
@@ -94,9 +94,9 @@ exports.format = {
             test.ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero');
         }
         if (moment().zone() === 0) {
-           test.equal(moment().zone(), 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
+           test.equal(moment().zone(), 0, 'moment.fn.zone should be a multiple of 15 (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() % 15, 0, 'moment.fn.zone should be a multiple of 15 (was ' + moment().zone() + ')');
         }
         test.equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset');
         test.done();
index 817404601a4677c8b8185481c913174bae2c92cf..c04805c11dfd23e5d44eb19c911f80ceecf0b73d 100644 (file)
@@ -20,7 +20,7 @@ exports.utc = {
             test.equal(m.date(), 2, "the date should be correct for local");
             test.equal(m.day(), 3, "the day should be correct for local");
         }
-        var zone = (m.zone() > 0) ? Math.ceil(m.zone() / 60) : Math.floor(m.zone() / 60);
+        var zone = (m.zone() > 0) ? Math.floor(m.zone() / 60) : Math.ceil(m.zone() / 60);
         var expected = (24 + 3 - zone) % 24;
         test.equal(m.hours(), expected, "the hours (" + m.hours() + ") should be correct for local");
         test.equal(moment().utc().zone(), 0, "timezone in utc should always be zero");