]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Switching to local timezone to fix dst test bug
authorTim Wood <washwithcare@gmail.com>
Mon, 19 Mar 2012 19:10:11 +0000 (12:10 -0700)
committerTim Wood <washwithcare@gmail.com>
Mon, 19 Mar 2012 19:10:11 +0000 (12:10 -0700)
test/moment/utc.js

index 3fc62099ef37433c23c8455c9b9fb57529dd00e6..5c6cf47915321b6cae784f3e88e697c73acbba45 100644 (file)
@@ -12,12 +12,12 @@ exports.utc = {
 
         // local
         m.local();
-        if (moment().zone() > 180) {
+        if (m.zone() > 180) {
             test.equal(m.date(), 1, "the day should be correct for utc");
         } else {
             test.equal(m.date(), 2, "the day should be correct for utc");
         }
-        var expected = (24 + 3 - Math.floor(moment().zone() / 60)) % 24;
+        var expected = (24 + 3 - Math.floor(m.zone() / 60)) % 24;
         test.equal(m.hours(), expected, "the hours (" + m.hours() + ") should be correct for utc");
         test.equal(moment().utc().zone(), 0, "timezone in utc should always be zero");
         test.done();