fix: confirm booking doesn't respect minimum booking notice (#14577)
Signed-off-by: Abhiuday <[email protected]>
This commit is contained in:
1 parent
ab26481738
commit
fc16ec59d3
2 files changed
+30
-12
No files matched your search
@@ -28,13 +28,21 @@ function isOutOfBounds(
|
||||
}: Pick<
|
||||
EventType,
|
||||
"periodType" | "periodDays" | "periodCountCalendarDays" | "periodStartDate" | "periodEndDate"
|
||||
>
|
||||
>,
|
||||
minimumBookingNotice?: number
|
||||
) {
|
||||
const date = dayjs(time);
|
||||
guardAgainstBookingInThePast(date.toDate());
|
||||
|
||||
periodDays = periodDays || 0;
|
||||
|
||||
if (minimumBookingNotice) {
|
||||
const minimumBookingStartDate = dayjs().add(minimumBookingNotice, "minutes");
|
||||
if (date.isBefore(minimumBookingStartDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (periodType) {
|
||||
case PeriodType.ROLLING: {
|
||||
const periodRollingEndDay = periodCountCalendarDays
|
||||
|
||||
Reference in new issue
Block a user