aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/edit')
-rw-r--r--web/app/view/edit/Devices.js20
1 files changed, 1 insertions, 19 deletions
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')
}]
}
});