diff --git a/web/src/routes/Events.jsx b/web/src/routes/Events.jsx
index dc123696d..72088f6d4 100644
--- a/web/src/routes/Events.jsx
+++ b/web/src/routes/Events.jsx
@@ -122,7 +122,7 @@ export default function Events({ path, ...props }) {
return memo;
}, config?.objects?.track || [])
.filter((value, i, self) => self.indexOf(value) === i),
- sub_labels: (allSubLabels || []).length > 0 ? [...Object.values(allSubLabels), "None"] : [],
+ sub_labels: (allSubLabels || []).length > 0 ? [...Object.values(allSubLabels), 'None'] : [],
}),
[config, allSubLabels]
);
@@ -295,6 +295,8 @@ export default function Events({ path, ...props }) {
return ;
}
+ const timezone = config.ui.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone;
+
return (
Events
@@ -512,8 +514,8 @@ export default function Events({ path, ...props }) {
({(event.top_score * 100).toFixed(0)}%)
- {new Date(event.start_time * 1000).toLocaleDateString()}{' '}
- {new Date(event.start_time * 1000).toLocaleTimeString()} (
+ {new Date(event.start_time * 1000).toLocaleDateString({ timeZone: timezone })}{' '}
+ {new Date(event.start_time * 1000).toLocaleTimeString({ timeZone: timezone })} (
{clipDuration(event.start_time, event.end_time)})
diff --git a/web/src/routes/Recording.jsx b/web/src/routes/Recording.jsx
index 6c33bb96c..b72fbb525 100644
--- a/web/src/routes/Recording.jsx
+++ b/web/src/routes/Recording.jsx
@@ -10,7 +10,7 @@ import useSWR from 'swr';
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
const { data: config } = useSWR('config');
- const timezone = config?.ui?.timezone ? config.ui.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
+ const 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]