From: Isaac Cambron Date: Tue, 17 Sep 2013 01:31:36 +0000 (-0400) Subject: using NaN instead of 0 X-Git-Tag: 2.3.0~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=820829b03c2c703d98dfc1acb8ffc1ac574a6b9c;p=thirdparty%2Fmoment.git using NaN instead of 0 --- diff --git a/moment.js b/moment.js index 671b7636e..da4fdf61c 100644 --- a/moment.js +++ b/moment.js @@ -1391,7 +1391,7 @@ }; moment.invalid = function () { - var m = moment.utc(0); + var m = moment.utc(NaN); m._isValid = false; return m; }; diff --git a/test/moment/invalid.js b/test/moment/invalid.js index 0521c0d36..be764c37f 100644 --- a/test/moment/invalid.js +++ b/test/moment/invalid.js @@ -4,7 +4,7 @@ exports.invalid = { "invalid" : function (test) { var m = moment.invalid(); test.equals(m.isValid(), false); - test.equals(m.valueOf(), new Date(0).valueOf()); + test.ok(isNaN(m.valueOf())); test.done(); } };