From: Tim Wood Date: Mon, 19 Mar 2012 19:10:11 +0000 (-0700) Subject: Switching to local timezone to fix dst test bug X-Git-Tag: 1.5.0~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d62a1ab8159465a765a2ba8f32832dbcdbc07482;p=thirdparty%2Fmoment.git Switching to local timezone to fix dst test bug --- diff --git a/test/moment/utc.js b/test/moment/utc.js index 3fc62099e..5c6cf4791 100644 --- a/test/moment/utc.js +++ b/test/moment/utc.js @@ -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();