From da247d688c0a8e5e38dce64e49694fa30e20f90c Mon Sep 17 00:00:00 2001 From: Nicolai Tellefsen Date: Sun, 3 Apr 2016 12:32:13 +0200 Subject: 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. --- web/nms.gathering.org/js/nms-map.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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++; -- cgit v1.2.3