]> git.ipfire.org Git - thirdparty/moment.git/commit
valueOf should return NaN for any invalid moment
authorJoshua Ohlman <codewriterohs@gmail.com>
Mon, 29 Jun 2015 20:44:02 +0000 (15:44 -0500)
committerJoshua Ohlman <codewriterohs@gmail.com>
Mon, 29 Jun 2015 20:44:02 +0000 (15:44 -0500)
commitc314f03a9b7153fcab55942878a9899ad74ce73e
treec9b6566d485c6794525a9c7461873f3695ff88d6
parent23753a542d5dae3b4d48d7963a48e98945817f7b
valueOf should return NaN for any invalid moment

this fixes an issue where isSame would return true for two invalid moments, which is inconsistent with NaN === NaN and also inconsistent with other cases where isSame would return false for two invalid moments. (some invalid moments are backed by a valid date)

Fixes #2354
src/lib/moment/to-type.js
src/test/moment/invalid.js
src/test/moment/is_same.js