From 197d7b893e85c68040e3fba1d5d2ec0a5985bebe Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 28 Aug 2017 15:30:49 +0500 Subject: Fix duration formatting --- web/app/AttributeFormatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index 957992d..d555205 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -55,7 +55,7 @@ Ext.define('Traccar.AttributeFormatter', { durationFormatter: function (value) { var hours, minutes; hours = Math.floor(value / 3600000); - minutes = Math.round(value % 3600000 / 60000); + minutes = value >= 60000 ? Math.floor(value % 3600000 / 60000) : Math.round(value / 60000); return hours + ' ' + Strings.sharedHourAbbreviation + ' ' + minutes + ' ' + Strings.sharedMinuteAbbreviation; }, -- cgit v1.2.3 From 164f648d107fee4a1fc47cd867096bd603a8d382 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 30 Aug 2017 09:16:46 +0500 Subject: Do not handle case when duration less than a minute --- web/app/AttributeFormatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index d555205..abe0f48 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -55,7 +55,7 @@ Ext.define('Traccar.AttributeFormatter', { durationFormatter: function (value) { var hours, minutes; hours = Math.floor(value / 3600000); - minutes = value >= 60000 ? Math.floor(value % 3600000 / 60000) : Math.round(value / 60000); + minutes = Math.floor(value % 3600000 / 60000); return hours + ' ' + Strings.sharedHourAbbreviation + ' ' + minutes + ' ' + Strings.sharedMinuteAbbreviation; }, -- cgit v1.2.3