diff --git a/lib/util.js b/lib/util.js index f9506a6a..55673cbd 100644 --- a/lib/util.js +++ b/lib/util.js @@ -392,8 +392,11 @@ exports.convert = function (object, type) { case 'number': case 'Number': - return Number(object.valueOf()); - + if (!isNaN(Date.parse(object))) { + return moment(object).valueOf(); + } else { + return Number(object.valueOf()); + } case 'string': case 'String': return String(object); @@ -1477,4 +1480,4 @@ exports.getScrollBarWidth = function () { document.body.removeChild (outer); return (w1 - w2); -}; \ No newline at end of file +};