From 56050b994d5944c9aa44b85b4a54d51cb058c3be Mon Sep 17 00:00:00 2001 From: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:31:59 -0500 Subject: [PATCH] fix 'attempt booking in the past' error (#12597) Co-authored-by: CarinaWolli Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> --- packages/trpc/server/routers/viewer/slots/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.ts index fbd63249b1..882a2281d0 100644 --- a/packages/trpc/server/routers/viewer/slots/util.ts +++ b/packages/trpc/server/routers/viewer/slots/util.ts @@ -292,7 +292,7 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) { }` ); const getStartTime = (startTimeInput: string, timeZone?: string) => { - const startTimeMin = dayjs.utc().add(eventType.minimumBookingNotice, "minutes"); + const startTimeMin = dayjs.utc().add(eventType.minimumBookingNotice || 1, "minutes"); const startTime = timeZone === "Etc/GMT" ? dayjs.utc(startTimeInput) : dayjs(startTimeInput).tz(timeZone); return startTimeMin.isAfter(startTime) ? startTimeMin.tz(timeZone) : startTime;