File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default function buildMatchFn (args) {
1515 var parsePatterns = ( width && args . parsePatterns [ width ] ) || args . parsePatterns [ args . defaultParseWidth ]
1616
1717 var value
18- if ( parsePatterns instanceof Array ) {
18+ if ( Object . prototype . toString . call ( parsePatterns ) === '[object Array]' ) {
1919 value = parsePatterns . findIndex ( function ( pattern ) {
2020 return pattern . test ( string )
2121 } )
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ export default function toDate (argument, dirtyOptions) {
101101 if ( argument instanceof Date ) {
102102 // Prevent the date to lose the milliseconds when passed to new Date() in IE10
103103 return new Date ( argument . getTime ( ) )
104- } else if ( typeof argument === 'number' || argument instanceof Number ) {
104+ } else if ( typeof argument === 'number' || Object . prototype . toString . call ( argument ) === '[object Number]' ) {
105105 return new Date ( argument )
106- } else if ( ! ( typeof argument === 'string' || argument instanceof String ) ) {
106+ } else if ( ! ( typeof argument === 'string' || Object . prototype . toString . call ( argument ) === '[object String]' ) ) {
107107 return new Date ( NaN )
108108 }
109109
You can’t perform that action at this time.
0 commit comments