aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Tellefsen <niccofyren@gmail.com>2016-03-25 07:56:24 +0100
committerNicolai Tellefsen <niccofyren@gmail.com>2016-03-25 07:56:24 +0100
commit14dbbc1451b4d5ea99e1937020e4fc79fe7ba1a7 (patch)
treebb865a70f0db9777f95b4968399ce38e46138695
parent9b21da6a4b4c6b06ab21b2d5b1b817b8556e2019 (diff)
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.
-rw-r--r--web/nms.gathering.org/js/nms-map.js6
1 files changed, 6 insertions, 0 deletions
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;