From f4719be1334fd10af77d2e69e0bf9b686b26bb29 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 29 Mar 2015 19:10:24 +0200 Subject: [PATCH] fix timezone handling --- lib/main.js | 6 +++--- lib/meshstats.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.js b/lib/main.js index 6b612f6..b88a8eb 100644 --- a/lib/main.js +++ b/lib/main.js @@ -50,8 +50,8 @@ function (config, moment, chroma, Router, Map, Sidebar, Tabs, Container, Meshsta }) nodes.forEach( function(node) { - node.firstseen = moment.utc(node.firstseen) - node.lastseen = moment.utc(node.lastseen) + node.firstseen = moment.utc(node.firstseen).local() + node.lastseen = moment.utc(node.lastseen).local() }) var now = moment() @@ -105,7 +105,7 @@ function (config, moment, chroma, Router, Map, Sidebar, Tabs, Container, Meshsta }) return { now: now, - timestamp: data[0].timestamp, + timestamp: moment.utc(data[0].timestamp).local(), nodes: { all: nodes, new: newnodes, diff --git a/lib/meshstats.js b/lib/meshstats.js index f972247..3f4b195 100644 --- a/lib/meshstats.js +++ b/lib/meshstats.js @@ -1,4 +1,4 @@ -define(["moment"], function (moment) { +define(function () { return function () { var self = this var p @@ -17,7 +17,7 @@ define(["moment"], function (moment) { totalGateways + " Gateways" p.appendChild(document.createElement("br")) - p.appendChild(document.createTextNode("Diese Daten sind von " + moment(d.timestamp).format("LLLL") + ".")) + p.appendChild(document.createTextNode("Diese Daten sind von " + d.timestamp.format("LLLL") + ".")) } self.render = function (el) {