From 723f91a1ac7be9c43177eebba4be75ac1ff96c09 Mon Sep 17 00:00:00 2001 From: Jim O'Brien Date: Tue, 3 Jan 2017 19:47:53 +0000 Subject: [PATCH] Don't pass non-string values to Date.parse (#2534) Fixes: #2490 (on the correct branch this time) --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 5a3ac76c..31ca9bb7 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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());