aboutsummaryrefslogtreecommitdiff
path: root/web/app/Application.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/Application.js')
-rw-r--r--web/app/Application.js35
1 files changed, 3 insertions, 32 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index 93f197fb1..91d2b7835 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.Application', {
requires: [
'Traccar.Resources',
- 'Traccar.ErrorManager'
+ 'Traccar.ErrorManager',
+ 'Traccar.AttributeFormatter'
],
models: [
@@ -68,36 +69,6 @@ Ext.define('Traccar.Application', {
getPreference: function(key, defaultValue) {
return this.getUser().get('distanceUnit') | this.getServer().get('distanceUnit') | defaultValue;
- },
-
- getRenderer: function(key) {
- if (key === 'latitude' || key === 'longitude') {
- return function(value) {
- return value.toFixed(5);
- }
- } else if (key === 'speed') {
- return function(value) {
- return Ext.getStore('SpeedUnits').formatValue(value, this.getPreference('speedUnit'));
- }
- } else if (key === 'course') {
- return function(value) {
- var directions = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];
- return directions[Math.floor(value / 45)];
- }
- } else if (key === 'distance' || key === 'odometer') {
- return function(value) {
- return Ext.getStore('DistanceUnits').formatValue(value, this.getPreference('distanceUnit'));
- }
- } else {
- return function(value) {
- if (value instanceof Number) {
- return value.toFixed(2);
- } else if (value instanceof Date) {
- return Ext.Date.format(value, styles.dateTimeFormat);
- }
- return value;
- }
- }
}
-
+
});