Fixing conversion in case of missing (aka 0) milliseconds.
This commit is contained in:
Родитель
362b141a67
Коммит
b51da50245
|
@ -49,7 +49,10 @@ exports.parse = function (stringDateTime) {
|
|||
var ymd = parts[0].split('-');
|
||||
var time = parts[1].split('.');
|
||||
var hms = time[0].split(':');
|
||||
var ms = time[1].split('Z');
|
||||
var ms = 0;
|
||||
if (time[1]) {
|
||||
ms = time[1].split('Z');
|
||||
}
|
||||
|
||||
var date = new Date(Date.UTC(
|
||||
parseInt(ymd[0], 10),
|
||||
|
@ -58,7 +61,7 @@ exports.parse = function (stringDateTime) {
|
|||
parseInt(hms[0], 10),
|
||||
parseInt(hms[1], 10),
|
||||
parseInt(hms[2], 10),
|
||||
Math.round(parseInt(rightPadSeven(ms[0]), 10)/10000))
|
||||
Math.round(parseInt(rightPadSeven(ms[0]), 10) / 10000))
|
||||
);
|
||||
|
||||
return date;
|
||||
|
|
Загрузка…
Ссылка в новой задаче