From a9c8b1b6c513257a5fd69cf00992d4fec59d6069 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 6 Nov 2022 17:00:03 -0800 Subject: Respect 12 hour time --- modern/src/map/MapPositions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modern/src/map/MapPositions.js') diff --git a/modern/src/map/MapPositions.js b/modern/src/map/MapPositions.js index e334800c..2f038ec6 100644 --- a/modern/src/map/MapPositions.js +++ b/modern/src/map/MapPositions.js @@ -4,7 +4,7 @@ import { map } from './core/MapView'; import { formatTime, getStatusColor } from '../common/util/formatter'; import { mapIconKey } from './core/preloadImages'; import { findFonts } from './core/mapUtil'; -import { useAttributePreference } from '../common/util/preferences'; +import { useAttributePreference, usePreference } from '../common/util/preferences'; const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleField }) => { const id = useId(); @@ -15,6 +15,7 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF const iconScale = useAttributePreference('iconScale', 1); const mapCluster = useAttributePreference('mapCluster', true); + const hours12 = usePreference('twelveHourFormat'); const createFeature = (devices, position, selectedPositionId) => { const device = devices[position.deviceId]; @@ -22,7 +23,7 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF id: position.id, deviceId: position.deviceId, name: device.name, - fixTime: formatTime(position.fixTime), + fixTime: formatTime(position.fixTime, 'seconds', hours12), category: mapIconKey(device.category), color: showStatus ? position.attributes.color || getStatusColor(device.status) : 'neutral', rotation: position.course, -- cgit v1.2.3