aboutsummaryrefslogtreecommitdiff
path: root/web/app/store/DistanceUnits.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/store/DistanceUnits.js')
-rw-r--r--web/app/store/DistanceUnits.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js
index cc9f1e9..57d15fc 100644
--- a/web/app/store/DistanceUnits.js
+++ b/web/app/store/DistanceUnits.js
@@ -33,6 +33,15 @@ Ext.define('Traccar.store.DistanceUnits', {
factor: 0.000539957
}],
+ convertValue: function (value, unit) {
+ var model;
+ if (!unit) {
+ unit = 'km';
+ }
+ model = this.findRecord('key', unit);
+ return value * model.get('factor');
+ },
+
formatValue: function (value, unit) {
var model;
if (!unit) {