aboutsummaryrefslogtreecommitdiff
path: root/modern/src/main/EventsDrawer.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-11-06 17:00:03 -0800
committerAnton Tananaev <anton@traccar.org>2022-11-06 17:00:03 -0800
commita9c8b1b6c513257a5fd69cf00992d4fec59d6069 (patch)
treeb2fa1bd33ae8766affb4ac1cfdba2dde5a9a54de /modern/src/main/EventsDrawer.js
parent4d6d5eca8c6ee8c43340d18d323816885edeb9da (diff)
downloadtrackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.tar.gz
trackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.tar.bz2
trackermap-web-a9c8b1b6c513257a5fd69cf00992d4fec59d6069.zip
Respect 12 hour time
Diffstat (limited to 'modern/src/main/EventsDrawer.js')
-rw-r--r--modern/src/main/EventsDrawer.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/modern/src/main/EventsDrawer.js b/modern/src/main/EventsDrawer.js
index 46664f87..67700fc4 100644
--- a/modern/src/main/EventsDrawer.js
+++ b/modern/src/main/EventsDrawer.js
@@ -9,6 +9,7 @@ import DeleteIcon from '@mui/icons-material/Delete';
import { formatNotificationTitle, formatTime } from '../common/util/formatter';
import { useTranslation } from '../common/components/LocalizationProvider';
import { eventsActions } from '../store';
+import { usePreference } from '../common/util/preferences';
const useStyles = makeStyles((theme) => ({
drawer: {
@@ -29,6 +30,8 @@ const EventsDrawer = ({ open, onClose }) => {
const dispatch = useDispatch();
const t = useTranslation();
+ const hours12 = usePreference('twelveHourFormat');
+
const devices = useSelector((state) => state.devices.items);
const events = useSelector((state) => state.events.items);
@@ -61,7 +64,10 @@ const EventsDrawer = ({ open, onClose }) => {
onClick={() => navigate(`/event/${event.id}`)}
disabled={!event.id}
>
- <ListItemText primary={`${devices[event.deviceId]?.name} • ${formatType(event)}`} secondary={formatTime(event.eventTime)} />
+ <ListItemText
+ primary={`${devices[event.deviceId]?.name} • ${formatType(event)}`}
+ secondary={formatTime(event.eventTime, 'seconds', hours12)}
+ />
<IconButton size="small" onClick={() => dispatch(eventsActions.delete(event))}>
<DeleteIcon fontSize="small" className={classes.negative} />
</IconButton>