Browse Source

fixed conversion from date-String to Number

codeClimate
Alexander Wunschik 8 years ago
parent
commit
24ffacb3e7
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      lib/util.js

+ 6
- 3
lib/util.js View File

@ -392,8 +392,11 @@ exports.convert = function (object, type) {
case 'number': case 'number':
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':
case 'String': case 'String':
return String(object); return String(object);
@ -1477,4 +1480,4 @@ exports.getScrollBarWidth = function () {
document.body.removeChild (outer); document.body.removeChild (outer);
return (w1 - w2); return (w1 - w2);
};
};

Loading…
Cancel
Save