mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-01 08:32:18 +03:00
Fix browser time format handling (#22694)
* implement hook to return resolved "24hour" | "12hour" string delegate to existing use24HourTime(), which correctly detects the browser's locale preference via Intl.DateTimeFormat * update frontend to use use24HourTime(config) or useTimeFormat(config) instead of directly comparing config.ui.time_format
This commit is contained in:
@@ -8,6 +8,7 @@ import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
|
||||
import useSWR from "swr";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTimeFormat } from "@/hooks/use-date-utils";
|
||||
|
||||
const GRAPH_COLORS = ["#3b82f6", "#ef4444"]; // RMS, dBFS
|
||||
|
||||
@@ -72,7 +73,7 @@ export function AudioLevelGraph({ cameraName }: AudioLevelGraphProps) {
|
||||
return [last.rms, last.dBFS];
|
||||
}, [audioData]);
|
||||
|
||||
const timeFormat = config?.ui.time_format === "24hour" ? "24hour" : "12hour";
|
||||
const timeFormat = useTimeFormat(config);
|
||||
const formatString = useMemo(
|
||||
() =>
|
||||
t(`time.formattedTimestampHourMinuteSecond.${timeFormat}`, {
|
||||
|
||||
Reference in New Issue
Block a user