@js-joda/core
Advanced tools
Comparing version 5.5.0 to 5.5.1
{ | ||
"name": "@js-joda/core", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "a date and time library for javascript", | ||
@@ -51,3 +51,3 @@ "repository": { | ||
}, | ||
"gitHead": "7388db45c1ac3aee66730d764075ede1429c38db" | ||
"gitHead": "a013e26d61c852b7c0ed9d76d2ba2516c32a79dc" | ||
} |
@@ -19,10 +19,8 @@ /* | ||
requireNonNull(zone, 'zone'); | ||
switch (date.constructor.name) { | ||
case 'Date': | ||
return Instant.ofEpochMilli(date.getTime()).atZone(zone); | ||
case 'Moment': | ||
return Instant.ofEpochMilli(date.valueOf()).atZone(zone); | ||
default: | ||
throw new IllegalArgumentException('date must be a javascript Date or a moment instance'); | ||
if(date instanceof Date) { | ||
return Instant.ofEpochMilli(date.getTime()).atZone(zone); | ||
} else if(typeof date.toDate === 'function' && date.toDate() instanceof Date) { | ||
return Instant.ofEpochMilli(date.valueOf()).atZone(zone); | ||
} | ||
throw new IllegalArgumentException('date must be a javascript Date or a moment instance'); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
7684288
61347