aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-24 12:29:45 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-24 12:29:45 +0530
commit85fa5aed51ee16a7f5258ab29a991c9e4007fc04 (patch)
tree32e9b2633bfd1869689c6e7f96baadd7f85e4980 /modern/src/reports
parent5b9f7db4f18d79570fa17bd61b82eec4452c2aa8 (diff)
downloadetbsa-traccar-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.tar.gz
etbsa-traccar-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.tar.bz2
etbsa-traccar-web-85fa5aed51ee16a7f5258ab29a991c9e4007fc04.zip
Implementing coordinate formatting
Diffstat (limited to 'modern/src/reports')
-rw-r--r--modern/src/reports/RouteReportPage.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js
index 33ccb34..bbe37e2 100644
--- a/modern/src/reports/RouteReportPage.js
+++ b/modern/src/reports/RouteReportPage.js
@@ -1,10 +1,10 @@
import React, { useState } from 'react';
import { DataGrid } from '@material-ui/data-grid';
import t from '../common/localization';
-import { formatPosition, formatDistance, formatSpeed, formatBoolean, formatDate, formatNumber } from '../common/formatter';
+import { formatDistance, formatSpeed, formatBoolean, formatDate, formatNumber, coordinateFormatter } from '../common/formatter';
import ReportFilter from './ReportFilter';
import ReportLayoutPage from './ReportLayoutPage';
-import { useAttributePreference } from '../common/preferences';
+import { useAttributePreference, usePreference } from '../common/preferences';
const Filter = ({ setItems }) => {
@@ -29,6 +29,7 @@ const Filter = ({ setItems }) => {
const RouteReportPage = () => {
const distanceUnit = useAttributePreference('distanceUnit');
const speedUnit = useAttributePreference('speedUnit');
+ const coordinateFormat = usePreference('coordinateFormat');
const columns = [{
headerName: t('positionFixTime'),
@@ -41,13 +42,13 @@ const RouteReportPage = () => {
field: 'latitude',
type: 'number',
flex: 1,
- valueFormatter: ({ value }) => formatNumber(value, 5),
+ valueFormatter: ({ value }) => coordinateFormatter('latitude', value, coordinateFormat),
}, {
headerName: t('positionLongitude'),
field: 'longitude',
type: 'number',
flex: 1,
- valueFormatter: ({ value }) => formatNumber(value, 5),
+ valueFormatter: ({ value }) => coordinateFormatter('longitude', value, coordinateFormat),
}, {
headerName: t('positionSpeed'),
field: 'speed',