From e45cd1597d6a0bb9ccc337bbab752bce71ce8184 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Fri, 13 Jan 2023 13:33:10 -0700 Subject: [PATCH] Set recordings timezone with config if available --- web/src/routes/Recording.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/routes/Recording.jsx b/web/src/routes/Recording.jsx index 7b904c707..6c33bb96c 100644 --- a/web/src/routes/Recording.jsx +++ b/web/src/routes/Recording.jsx @@ -9,7 +9,8 @@ import { useApiHost } from '../api'; import useSWR from 'swr'; export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) { - const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const { data: config } = useSWR('config'); + const timezone = config?.ui?.timezone ? config.ui.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone; const currentDate = useMemo( () => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()), [date, hour, minute, second]