mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Set recordings timezone with config if available
This commit is contained in:
parent
70a8ac1f35
commit
e45cd1597d
@ -9,7 +9,8 @@ import { useApiHost } from '../api';
|
|||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
|
|
||||||
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
|
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(
|
const currentDate = useMemo(
|
||||||
() => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()),
|
() => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()),
|
||||||
[date, hour, minute, second]
|
[date, hour, minute, second]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user