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

* fix: coulmn view date change

* Update store.ts

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Anik Dhabal BabuandUdit Takkar authored and GitHub committed 2025-02-18 18:46:46 +05:30
1 parent 4a493c0a0e
commit 99260974f4
1 file changed
+7 -1
+7 -1
View File
@@ -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()) {