diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-12 10:13:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-12 10:13:45 +0300 |
commit | 5d3b7cbe5924d4a4552035626a83e26b1e756255 (patch) | |
tree | 18c1caaba30f7bb9e6c21cce492d93a85ebc1c73 /web/app/AttributeFormatter.js | |
parent | 1f11fa7db020f8a46e4b298dc61277460d76b678 (diff) | |
parent | 9a55f2b000956717d5caf6fb53793264c0376ce7 (diff) | |
download | trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.gz trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.bz2 trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.zip |
Merge pull request #2206 from Abyss777/ignition
Ignition and Motor Hours
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index 3432ca1e0..274b8d028 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -34,6 +34,11 @@ Ext.define('Traccar.AttributeFormatter', { return Ext.getStore('DistanceUnits').formatValue(value, Traccar.app.getPreference('distanceUnit')); }, + hoursFormatter: function (value) { + var hours = Math.round(value / 3600000); + return (hours + ' ' + Strings.sharedHourAbbreviation); + }, + defaultFormatter: function (value) { if (typeof value === 'number') { return Number(value.toFixed(Traccar.Style.numberPrecision)); @@ -58,6 +63,8 @@ Ext.define('Traccar.AttributeFormatter', { return this.courseFormatter; } else if (key === 'distance' || key === 'odometer') { return this.distanceFormatter; + } else if (key === 'hours') { + return this.hoursFormatter; } else { return this.defaultFormatter; } |