From 02de01261e569725d494972f5233a110e2d6273e Mon Sep 17 00:00:00 2001 From: 0x464e <36742501+0x464e@users.noreply.github.com> Date: Sun, 5 Apr 2026 15:23:41 +0300 Subject: [PATCH] Use new timeformat hook --- web/src/components/overlay/ShareTimestampDialog.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/components/overlay/ShareTimestampDialog.tsx b/web/src/components/overlay/ShareTimestampDialog.tsx index 44bbc141b..9911bca5c 100644 --- a/web/src/components/overlay/ShareTimestampDialog.tsx +++ b/web/src/components/overlay/ShareTimestampDialog.tsx @@ -16,7 +16,7 @@ import { } from "@/components/ui/popover"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Separator } from "@/components/ui/separator"; -import { useFormattedTimestamp } from "@/hooks/use-date-utils"; +import { useFormattedTimestamp, useTimeFormat } from "@/hooks/use-date-utils"; import { cn } from "@/lib/utils"; import { FrigateConfig } from "@/types/frigateConfig"; import { getUTCOffset } from "@/utils/dateUtil"; @@ -120,9 +120,10 @@ export function ShareTimestampContent({ }: Readonly) { const { t } = useTranslation(["common", "components/dialog"]); const { data: config } = useSWR("config"); + const timeFormat = useTimeFormat(config); const currentTimestampLabel = useFormattedTimestamp( currentTime, - config?.ui.time_format == "24hour" + timeFormat == "24hour" ? t("time.formattedTimestamp.24hour") : t("time.formattedTimestamp.12hour"), config?.ui.timezone, @@ -236,6 +237,7 @@ function CustomTimestampSelector({ }: Readonly) { const { t } = useTranslation(["common"]); const { data: config } = useSWR("config"); + const timeFormat = useTimeFormat(config); const timezoneOffset = useMemo( () => @@ -271,7 +273,7 @@ function CustomTimestampSelector({ const formattedTimestamp = useFormattedTimestamp( displayTimestamp, - config?.ui.time_format == "24hour" + timeFormat == "24hour" ? t("time.formattedTimestamp.24hour") : t("time.formattedTimestamp.12hour"), );