Skip to content

Commit 341beac

Browse files
authored
Ensure valueOf returns NaN for invalid instances (#1082)
Closes #1075
1 parent dc53e6c commit 341beac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

moment-timezone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@
640640
offset;
641641

642642
if (mom._z === undefined) {
643-
if (zone && needsOffset(mom) && !mom._isUTC) {
643+
if (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {
644644
mom._d = moment.utc(mom._a)._d;
645645
mom.utc().add(zone.parse(mom), 'minutes');
646646
}

0 commit comments

Comments
 (0)