[TASK] Remove unnecessary moment

This commit is contained in:
Xaver Maierhofer 2018-08-06 16:50:27 +02:00
parent 712c3f21ce
commit 2192500d05
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
2 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/node'], define(['sorttable', 'snabbdom', 'd3-interpolate', 'helper', 'utils/node'],
function (SortTable, V, d3Interpolate, moment, helper, nodef) { function (SortTable, V, d3Interpolate, helper, nodef) {
'use strict'; 'use strict';
V = V.default; V = V.default;

View File

@ -20,8 +20,7 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
node.lastseen = moment.utc(node.lastseen).local(); node.lastseen = moment.utc(node.lastseen).local();
}); });
var now = moment(); var age = moment().subtract(config.maxAge, 'days');
var age = moment(now).subtract(config.maxAge, 'days');
var online = nodes.filter(function (d) { var online = nodes.filter(function (d) {
return d.is_online; return d.is_online;
@ -58,7 +57,7 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
}); });
return { return {
now: now, now: moment(),
timestamp: moment.utc(timestamp).local(), timestamp: moment.utc(timestamp).local(),
nodes: { nodes: {
all: nodes, all: nodes,