Skip to content

Commit

Permalink
Date is shown as NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
innerjoin committed Oct 16, 2017
1 parent d30d0eb commit 3ea5b78
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion resources/ui/Presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define([
"dijit/_WidgetBase",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"dijit/Tooltip",
"dijit/Tooltip",
"dojo/Deferred",
"dojo/on",
"dojo/promise/all",
Expand Down Expand Up @@ -95,6 +95,13 @@ define([
for(var i = 0; i < stateEntries.length; i++) {
var stateId = stateEntries[i].getElementsByTagName("stateId")[0].textContent;
var modified = stateEntries[i].getElementsByTagName("modified")[0].textContent;
var exp = /(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}\+\d{2})(\d{2})/;
var splitDate = modified.match(exp);
if(splitDate.length === 3) {
modified = splitDate[1] + ":" + splitDate[2];
modified = new Date(modified);
}
console.log(modified);
var state = stateEntries[i].getElementsByTagName("state")[0].textContent;
states[i] = {
stateId: stateId,
Expand Down

1 comment on commit 3ea5b78

@innerjoin
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes #8

Please sign in to comment.