aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-02 18:08:33 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-02 18:08:33 -0700
commit23189d6bc945ab4e26e336a42dce138d0bbb3523 (patch)
treeed0b1410206a1dd0bfa3dbe05be5dd799be81dd7 /modern/src/common
parentf52be84522da7f8e1c2b19d3484250e275252799 (diff)
downloadtrackermap-web-23189d6bc945ab4e26e336a42dce138d0bbb3523.tar.gz
trackermap-web-23189d6bc945ab4e26e336a42dce138d0bbb3523.tar.bz2
trackermap-web-23189d6bc945ab4e26e336a42dce138d0bbb3523.zip
Remove position formatter
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/formatter.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js
index fed29a9d..bc3af6fb 100644
--- a/modern/src/common/formatter.js
+++ b/modern/src/common/formatter.js
@@ -13,36 +13,6 @@ export const formatTime = (value, format = 'YYYY-MM-DD HH:mm:ss') => moment(valu
export const formatStatus = (value, t) => t(prefixString('deviceStatus', value));
export const formatAlarm = (value, t) => t(prefixString('alarm', value));
-export const formatPosition = (value, key, t) => {
- if (value != null && typeof value === 'object') {
- value = value[key];
- }
- switch (key) {
- case 'fixTime':
- case 'deviceTime':
- case 'serverTime':
- case 'eventTime':
- return formatTime(value);
- case 'latitude':
- case 'longitude':
- return value.toFixed(5);
- case 'speed':
- case 'course':
- return value.toFixed(1);
- case 'batteryLevel':
- return formatPercentage(value);
- case 'alarm':
- return formatAlarm(value, t);
- default:
- if (typeof value === 'number') {
- return formatNumber(value);
- } if (typeof value === 'boolean') {
- return formatBoolean(value, t);
- }
- return value;
- }
-};
-
export const formatCourse = (value) => {
const courseValues = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];
return courseValues[Math.floor(value / 45)];