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:
1 parent
4a493c0a0e
commit
99260974f4
1 file changed
+7
-1
@@ -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()) {
|
||||
|
||||
Reference in new issue
Block a user