Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

Commit 9e7153d

Browse files
author
Edmundo Alvarez
committed
Also parse datetimes in ISO8601 format, fixes #792
1 parent 59ca378 commit 9e7153d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/javascripts/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,8 @@ function generateId() {
10471047

10481048
// Browsers fail with all kinds of date formats. Passing every part of the date as a constructor parameter seems to be the safest way to go.
10491049
function parseDateFromString(src) {
1050-
var parts = /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/.exec(src);
1050+
// Parses datetimes like 2014-06-26 15:26:17 and 2014-06-25T22:15:26.000Z
1051+
var parts = /(\d+)-(\d+)-(\d+)[T\s](\d+):(\d+):(\d+)(?:.(\d+)Z)?/.exec(src);
10511052

10521053
var millis = 0;
10531054
if (parts[7] != "" && parts[7] != undefined) {

0 commit comments

Comments
 (0)