Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Issues with date changes in column view (#19258)

Anik Dhabal Babu99260974f48e
diff --git a/packages/features/bookings/Booker/store.ts b/packages/features/bookings/Booker/store.ts
index 2ed4f11651a..331217cecc5 100644
--- a/packages/features/bookings/Booker/store.ts
+++ b/packages/features/bookings/Booker/store.ts
@@ -210,7 +210,13 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
},
addToSelectedDate: (days: number) => {
const currentSelection = dayjs(get().selectedDate);
- const newSelection = currentSelection.add(days, "day");
+ let newSelection = currentSelection.add(days, "day");
+
+ // If newSelection is before the current date, set it to today
+ if (newSelection.isBefore(dayjs(), "day")) {
+ newSelection = dayjs();
+ }
+
const newSelectionFormatted = newSelection.format("YYYY-MM-DD");
if (newSelection.month() !== currentSelection.month()) {