From 66c2537f9f16d0cdc0f7ac529900e331ba4df59c Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 1 Nov 2022 19:29:44 +0530 Subject: [PATCH] fix: use timeformat from getMe query (#5314) Co-authored-by: Peer Richelsen Co-authored-by: Bailey Pumfleet --- apps/web/pages/availability/[schedule].tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx index b16781b9f3..ca32a4c627 100644 --- a/apps/web/pages/availability/[schedule].tsx +++ b/apps/web/pages/availability/[schedule].tsx @@ -42,7 +42,7 @@ export default function Availability({ schedule }: { schedule: number }) { const router = useRouter(); const utils = trpc.useContext(); const me = useMeQuery(); - + const { timeFormat } = me.data || { timeFormat: null }; const { data, isLoading } = trpc.useQuery(["viewer.availability.schedule", { scheduleId: schedule }]); const form = useForm(); @@ -94,7 +94,7 @@ export default function Availability({ schedule }: { schedule: number }) { data ? ( data.schedule.availability.map((availability) => ( - {availabilityAsString(availability, { locale: i18n.language })} + {availabilityAsString(availability, { locale: i18n.language, hour12: timeFormat === 12 })}
))