Skip to content

Commit f818fc6

Browse files
author
Martijn Swaagman
committed
[fix] check Date through Object.toString
1 parent e879835 commit f818fc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function toMilliseconds(options: Options, ...keys: Array<string>) {
66
const value = options[key];
77

88
// Is it a Date object?
9-
if (typeof value === 'object' && typeof value.getMonth === 'function') {
9+
if (Object.prototype.toString.call(value) === '[object Date]') {
1010
options[key] = value.getTime();
1111
}
1212
});

0 commit comments

Comments
 (0)