diff options
author | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-04-03 12:32:13 +0200 |
---|---|---|
committer | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-04-03 12:32:13 +0200 |
commit | da247d688c0a8e5e38dce64e49694fa30e20f90c (patch) | |
tree | 948482f8fb9edd4ceff29436f23f7334c1d448de | |
parent | b2768b697599d51ef4d1ecd2dfb05d3ec5515602 (diff) |
NMS: Let drawNow handle both epoch and date-string
Unsure how to handle UTC vs non UTC. Atleast we can now see a date in
both time-travel and live-data mode drawn to the map.
-rw-r--r-- | web/nms.gathering.org/js/nms-map.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web/nms.gathering.org/js/nms-map.js b/web/nms.gathering.org/js/nms-map.js index c64a387..224b3db 100644 --- a/web/nms.gathering.org/js/nms-map.js +++ b/web/nms.gathering.org/js/nms-map.js @@ -180,7 +180,11 @@ nmsMap._resizeEvent = function() { nmsMap.drawNow = function () { var now = nmsData.now; - now = new Date(nmsData.now); //Date assumes UTC + if(String(now).indexOf('T') == -1) { //If now does not contain 'T' we assume its in epoch format + now = new Date(nmsData.now * 1000); + } else { + now = new Date(nmsData.now); //Date assumes UTC + } now = now.toString().split(' ').splice(1,4).join(' '); //Date returns local time if (nmsMap._lastNow == now) { nmsMap.stats.nowDups++; |