mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-06 10:57:22 +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:
@@ -10,7 +10,11 @@ import {
|
||||
import useSWR from "swr";
|
||||
import { CiCircleAlert } from "react-icons/ci";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { useFormattedTimestamp, useTimezone } from "@/hooks/use-date-utils";
|
||||
import {
|
||||
useFormattedTimestamp,
|
||||
useTimeFormat,
|
||||
useTimezone,
|
||||
} from "@/hooks/use-date-utils";
|
||||
import { RecordingsSummary } from "@/types/review";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TZDate } from "react-day-picker";
|
||||
@@ -81,7 +85,7 @@ export default function StorageMetrics({
|
||||
: null;
|
||||
}, [recordingsSummary, timezone]);
|
||||
|
||||
const timeFormat = config?.ui.time_format === "24hour" ? "24hour" : "12hour";
|
||||
const timeFormat = useTimeFormat(config);
|
||||
const format = useMemo(() => {
|
||||
return t(`time.formattedTimestampMonthDayYear.${timeFormat}`, {
|
||||
ns: "common",
|
||||
|
||||
Reference in New Issue
Block a user