Browse Source

Don't pass non-string values to Date.parse (#2534)

Fixes: #2490 (on the correct branch this time)
fix2580
Jim O'Brien 7 years ago
committed by yotamberk
parent
commit
723f91a1ac
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/util.js

+ 1
- 1
lib/util.js View File

@ -409,7 +409,7 @@ exports.convert = function (object, type) {
case 'number':
case 'Number':
if (!isNaN(Date.parse(object))) {
if (exports.isString(object) && !isNaN(Date.parse(object))) {
return moment(object).valueOf();
} else {
return Number(object.valueOf());

Loading…
Cancel
Save