From 3f3ffa2ba8f38c5cd187683a516c6b0d0fc5b111 Mon Sep 17 00:00:00 2001 From: alannnc Date: Wed, 29 Jun 2022 03:01:30 -0600 Subject: [PATCH] fix/availability-tz-offset (#3185) --- apps/web/components/booking/pages/AvailabilityPage.tsx | 6 ++---- apps/web/lib/slots.ts | 7 +++++++ apps/web/server/routers/viewer/slots.tsx | 7 +++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index 4b185568e9..655c9dd174 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -31,7 +31,6 @@ import { } from "@calcom/embed-core/embed-iframe"; import classNames from "@calcom/lib/classNames"; import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; -import { yyyymmdd } from "@calcom/lib/date-fns"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { getRecurringFreq } from "@calcom/lib/recurringStrings"; import { localStorage } from "@calcom/lib/webstorage"; @@ -125,8 +124,8 @@ const useSlots = ({ { eventTypeId, startTime: startTime?.toISOString() || "", - timeZone, endTime: endTime?.toISOString() || "", + timeZone, }, ], { enabled: !!startTime && !!endTime } @@ -182,7 +181,6 @@ const SlotPicker = ({ }, [router.isReady, month, date, timeZone]); const { i18n, isLocaleReady } = useLocale(); - const { slots: _1 } = useSlots({ eventTypeId: eventType.id, startTime: selectedDate?.startOf("day"), @@ -224,7 +222,7 @@ const SlotPicker = ({ {selectedDate && ( ({ + slots[time.format("YYYY-MM-DD")] = filteredTimes.map((time) => ({ time: time.toISOString(), users: eventType.users.map((user) => user.username || ""), // Conditionally add the attendees and booking id to slots object if there is already a booking during that time