From 14dbbc1451b4d5ea99e1937020e4fc79fe7ba1a7 Mon Sep 17 00:00:00 2001 From: Nicolai Tellefsen Date: Fri, 25 Mar 2016 07:56:24 +0100 Subject: NMS: Temporary map time adjustment Convert now-time from nmsData before displaying it in nmsMap in order to go from UTC to local time and a cleaner output format. --- web/nms.gathering.org/js/nms-map.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/nms.gathering.org/js/nms-map.js') diff --git a/web/nms.gathering.org/js/nms-map.js b/web/nms.gathering.org/js/nms-map.js index ada6886..c64a387 100644 --- a/web/nms.gathering.org/js/nms-map.js +++ b/web/nms.gathering.org/js/nms-map.js @@ -172,10 +172,16 @@ nmsMap._resizeEvent = function() { * * FIXME: 2: Should really just use _drawText() instead somehow. Font size * being an issue. + * + * FIXME 3: Currently assuming that time from api is UTC and converting to + * local time zone with js. Should find a more robust solution. + * */ nmsMap.drawNow = function () { var now = nmsData.now; + 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++; return; -- cgit v1.2.3