From: Tim Wood Date: Thu, 27 Jun 2013 18:20:16 +0000 (-0700) Subject: fixing failing dst tests X-Git-Tag: 2.1.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=001e31ca833545dd479b695b23f1d3bc3f7c9ebe;p=thirdparty%2Fmoment.git fixing failing dst tests --- diff --git a/test/moment/diff.js b/test/moment/diff.js index 3ffce947c..997d812a0 100644 --- a/test/moment/diff.js +++ b/test/moment/diff.js @@ -26,7 +26,7 @@ function dstForYear(year) { if (last.zone() !== current.zone()) { return { moment : last, - diff : (last.zone() - current.zone()) / 60 + diff : (current.zone() - last.zone()) / 60 }; } } @@ -144,6 +144,7 @@ exports.diff = { a = dst.moment; b = a.clone().utc().add(12 + dst.diff, 'hours').local(); daysInMonth = (a.daysInMonth() + b.daysInMonth()) / 2; + equal(test, b.diff(a, 'ms', true), (12 + dst.diff) * 60 * 60 * 1000, "ms diff across DST"); equal(test, b.diff(a, 's', true), (12 + dst.diff) * 60 * 60, "second diff across DST"); equal(test, b.diff(a, 'm', true), (12 + dst.diff) * 60, "minute diff across DST");