From f0277f8eb3cd4525f3b45ea957cddb36fb70bdd5 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 6 Jun 2022 07:00:49 -0600 Subject: [PATCH] Apply timestamp option to recordings page as well --- web/src/components/RecordingPlaylist.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/components/RecordingPlaylist.jsx b/web/src/components/RecordingPlaylist.jsx index 4d6f93842..0360e5334 100644 --- a/web/src/components/RecordingPlaylist.jsx +++ b/web/src/components/RecordingPlaylist.jsx @@ -144,7 +144,11 @@ export function EventCard({ camera, event }) { const apiHost = useApiHost(); const start = fromUnixTime(event.start_time); const end = fromUnixTime(event.end_time); + + const { data: config } = useSWR('config'); + let duration = 'In Progress'; + if (event.end_time) { duration = formatDuration(intervalToDuration({ start, end })); } @@ -160,7 +164,7 @@ export function EventCard({ camera, event }) {
{event.label}
-
Start: {format(start, 'HH:mm:ss')}
+
Start: {format(start, `${config.ui.timestamp.hour_12 ? 'hh' : 'HH'}:mm:ss ${config.ui.timestamp.hour_12 ? 'a' : ''}`)}
Duration: {duration}
{(event.top_score * 100).toFixed(1)}%