From 78c121fcb45c5fe5a6509c90898811d7e9d7a253 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 22 Apr 2017 10:16:54 +1200 Subject: Avoid negative last update (fix #475) --- web/app/view/edit/Devices.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index 7c1f935..b5b6bad 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -163,6 +163,9 @@ Ext.define('Traccar.view.edit.Devices', { if (value) { seconds = Math.floor((new Date() - value) / 1000); + if (seconds < 0) { + seconds = 0; + } interval = Math.floor(seconds / 86400); if (interval > 1) { return interval + ' ' + Strings.sharedDays; -- cgit v1.2.3