]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fixing unit tests in all timezones
authorTim Wood <washwithcare@gmail.com>
Fri, 4 May 2012 16:45:54 +0000 (12:15 -0430)
committerTim Wood <washwithcare@gmail.com>
Fri, 4 May 2012 16:45:54 +0000 (12:15 -0430)
test/moment/utc.js

index c04805c11dfd23e5d44eb19c911f80ceecf0b73d..26a66a28c20aa0b4b2da6ea8fc8b497d7412d05a 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.floor(m.zone() / 60) : Math.ceil(m.zone() / 60);
+        var zone = 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");