aboutsummaryrefslogtreecommitdiff
path: root/web/app/store/SpeedUnits.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-08 12:03:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-08 12:03:27 +1200
commit62a584aea59666bd95d0a88e917f24fe5999df16 (patch)
treedde786f36bd2d94fd6178646acc97a0f92e0244d /web/app/store/SpeedUnits.js
parentff266d342ae3c6922005f043470ef659447882b5 (diff)
downloadtrackermap-server-62a584aea59666bd95d0a88e917f24fe5999df16.tar.gz
trackermap-server-62a584aea59666bd95d0a88e917f24fe5999df16.tar.bz2
trackermap-server-62a584aea59666bd95d0a88e917f24fe5999df16.zip
Add knots option for speed value
Diffstat (limited to 'web/app/store/SpeedUnits.js')
-rw-r--r--web/app/store/SpeedUnits.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js
index d02892a01..296f58636 100644
--- a/web/app/store/SpeedUnits.js
+++ b/web/app/store/SpeedUnits.js
@@ -19,6 +19,10 @@ Ext.define('Traccar.store.SpeedUnits', {
fields: ['key', 'name', 'factor'],
data: [{
+ key: 'kn',
+ name: Strings.sharedKn,
+ factor: 1
+ }, {
key: 'kmh',
name: Strings.sharedKmh,
factor: 1.852
@@ -30,11 +34,10 @@ Ext.define('Traccar.store.SpeedUnits', {
formatValue: function (value, unit) {
var model;
- if (unit) {
- model = this.findRecord('key', unit);
- return (value * model.get('factor')).toFixed(1) + ' ' + model.get('name');
- } else {
- return value;
+ if (!unit) {
+ unit = 'kn';
}
+ model = this.findRecord('key', unit);
+ return (value * model.get('factor')).toFixed(1) + ' ' + model.get('name');
}
});