diff options
author | Anton Tananaev <anton@traccar.org> | 2022-11-06 17:00:03 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-11-06 17:00:03 -0800 |
commit | a9c8b1b6c513257a5fd69cf00992d4fec59d6069 (patch) | |
tree | b2fa1bd33ae8766affb4ac1cfdba2dde5a9a54de /modern/src/reports/StopReportPage.js | |
parent | 4d6d5eca8c6ee8c43340d18d323816885edeb9da (diff) | |
download | trackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.tar.gz trackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.tar.bz2 trackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.zip |
Respect 12 hour time
Diffstat (limited to 'modern/src/reports/StopReportPage.js')
-rw-r--r-- | modern/src/reports/StopReportPage.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modern/src/reports/StopReportPage.js b/modern/src/reports/StopReportPage.js index a322304e..ce790401 100644 --- a/modern/src/reports/StopReportPage.js +++ b/modern/src/reports/StopReportPage.js @@ -9,7 +9,7 @@ import { formatDistance, formatHours, formatVolume, formatTime, } from '../common/util/formatter'; import ReportFilter from './components/ReportFilter'; -import { useAttributePreference } from '../common/util/preferences'; +import { useAttributePreference, usePreference } from '../common/util/preferences'; import { useTranslation } from '../common/components/LocalizationProvider'; import PageLayout from '../common/components/PageLayout'; import ReportsMenu from './components/ReportsMenu'; @@ -41,6 +41,7 @@ const StopReportPage = () => { const distanceUnit = useAttributePreference('distanceUnit'); const volumeUnit = useAttributePreference('volumeUnit'); + const hours12 = usePreference('twelveHourFormat'); const [columns, setColumns] = usePersistedState('stopColumns', ['startTime', 'endTime', 'startOdometer', 'address']); const [items, setItems] = useState([]); @@ -77,7 +78,7 @@ const StopReportPage = () => { switch (key) { case 'startTime': case 'endTime': - return formatTime(item[key], 'YYYY-MM-DD HH:mm'); + return formatTime(item[key], 'minutes', hours12); case 'startOdometer': return formatDistance(item[key], distanceUnit, t); case 'duration': |