From 20022e2cdda26beb902b7937be1a33b083bf6259 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Fri, 24 Mar 2023 20:37:46 -0400 Subject: [PATCH] Fix minimum booking notice set to 0 (#7750) * Only use the current day * Set min of booking notice to 0 * Set min minimumBookingNotice to 0 --- apps/web/components/booking/SlotPicker.tsx | 5 +---- apps/web/components/eventtype/EventLimitsTab.tsx | 1 + packages/prisma/schema.prisma | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/components/booking/SlotPicker.tsx b/apps/web/components/booking/SlotPicker.tsx index d75beb8d7c..6d8d2867fa 100644 --- a/apps/web/components/booking/SlotPicker.tsx +++ b/apps/web/components/booking/SlotPicker.tsx @@ -133,10 +133,7 @@ export const SlotPicker = ({ eventTypeId: eventType.id, eventTypeSlug: eventType.slug, usernameList: users, - startTime: - browsingDate === undefined || browsingDate.get("month") === dayjs.tz(undefined, timeZone).get("month") - ? dayjs.tz(undefined, timeZone).subtract(2, "days").startOf("day") - : browsingDate?.startOf("month"), + startTime: dayjs().startOf("day"), endTime: browsingDate?.endOf("month"), timeZone, duration, diff --git a/apps/web/components/eventtype/EventLimitsTab.tsx b/apps/web/components/eventtype/EventLimitsTab.tsx index 634915e056..53a5f01f77 100644 --- a/apps/web/components/eventtype/EventLimitsTab.tsx +++ b/apps/web/components/eventtype/EventLimitsTab.tsx @@ -88,6 +88,7 @@ const MinimumBookingNoticeInput = React.forwardRef< label={t("minimum_booking_notice")} type="number" placeholder="0" + min={0} className="mb-0 h-[38px] rounded-[4px] ltr:mr-2 rtl:ml-2" /> diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prisma index 4be22eff60..23206928c9 100644 --- a/packages/prisma/schema.prisma +++ b/packages/prisma/schema.prisma @@ -77,6 +77,7 @@ model EventType { recurringEvent Json? disableGuests Boolean @default(false) hideCalendarNotes Boolean @default(false) + /// @zod.min(0) minimumBookingNotice Int @default(120) beforeEventBuffer Int @default(0) afterEventBuffer Int @default(0)