]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
using NaN instead of 0
authorIsaac Cambron <isaac@isaaccambron.com>
Tue, 17 Sep 2013 01:31:36 +0000 (21:31 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 26 Sep 2013 07:46:16 +0000 (00:46 -0700)
moment.js
test/moment/invalid.js

index 671b7636e68de48796ea0c7fc2d67795598e3e25..da4fdf61c08a62da710fc2eab9e68e576e205cb8 100644 (file)
--- a/moment.js
+++ b/moment.js
     };
 
     moment.invalid = function () {
-        var m = moment.utc(0);
+        var m = moment.utc(NaN);
         m._isValid = false;
         return m;
     };
index 0521c0d367f629275b0187635a500c5b426d850e..be764c37fae867ee872bbceb9b5d0d83beae763a 100644 (file)
@@ -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();
     }
 };