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/StatisticsPage.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/StatisticsPage.js')
-rw-r--r-- | modern/src/reports/StatisticsPage.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/reports/StatisticsPage.js b/modern/src/reports/StatisticsPage.js index 254a912d..7b3f2879 100644 --- a/modern/src/reports/StatisticsPage.js +++ b/modern/src/reports/StatisticsPage.js @@ -12,6 +12,7 @@ import ColumnSelect from './components/ColumnSelect'; import { useCatch } from '../reactHelper'; import useReportStyles from './common/useReportStyles'; import TableShimmer from '../common/components/TableShimmer'; +import { usePreference } from '../common/util/preferences'; const columnsArray = [ ['captureTime', 'statisticsCaptureTime'], @@ -31,6 +32,8 @@ const StatisticsPage = () => { const classes = useReportStyles(); const t = useTranslation(); + const hours12 = usePreference('twelveHourFormat'); + const [columns, setColumns] = usePersistedState('statisticsColumns', ['captureTime', 'activeUsers', 'activeDevices', 'messagesStored']); const [items, setItems] = useState([]); const [loading, setLoading] = useState(false); @@ -68,7 +71,7 @@ const StatisticsPage = () => { <TableRow key={item.id}> {columns.map((key) => ( <TableCell key={key}> - {key === 'captureTime' ? formatTime(item[key], 'YYYY-MM-DD') : item[key]} + {key === 'captureTime' ? formatTime(item[key], 'date', hours12) : item[key]} </TableCell> ))} </TableRow> |