From 35e8f4b4974515733737c5cc1dd439ca47860007 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 31 May 2017 16:55:00 +0500 Subject: Implement Events panel --- web/app/view/edit/Devices.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'web/app/view/edit/Devices.js') diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index fe3de42c..196df733 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -166,25 +166,7 @@ Ext.define('Traccar.view.edit.Devices', { }, { text: Strings.deviceLastUpdate, dataIndex: 'lastUpdate', - renderer: function (value, metaData, record) { - var seconds, interval; - - 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; - } - interval = Math.floor(seconds / 3600); - if (interval > 1) { - return interval + ' ' + Strings.sharedHours; - } - return Math.floor(seconds / 60) + ' ' + Strings.sharedMinutes; - } - } + renderer: Traccar.AttributeFormatter.getFormatter('lastUpdate') }] } }); -- cgit v1.2.3