fix: use timeformat from getMe query (#5314)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
pull/5306/head^2
Udit Takkar 2022-11-01 19:29:44 +05:30 committed by GitHub
parent b3d74e575a
commit 66c2537f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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<AvailabilityFormValues>();
@ -94,7 +94,7 @@ export default function Availability({ schedule }: { schedule: number }) {
data ? (
data.schedule.availability.map((availability) => (
<span key={availability.id}>
{availabilityAsString(availability, { locale: i18n.language })}
{availabilityAsString(availability, { locale: i18n.language, hour12: timeFormat === 12 })}
<br />
</span>
))