|
Lines 787-792
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
| 787 |
|
787 |
|
| 788 |
// Update the maxDate option of the flatpickr instance |
788 |
// Update the maxDate option of the flatpickr instance |
| 789 |
instance.set("maxDate", maxDate); |
789 |
instance.set("maxDate", maxDate); |
|
|
790 |
|
| 791 |
// Re-apply startRange class after redraw |
| 792 |
// Flatpickr may lose this class when maxDate triggers a redraw |
| 793 |
setTimeout(() => { |
| 794 |
// Only apply if still in "start date only" state |
| 795 |
if (instance.selectedDates.length !== 1) { |
| 796 |
return; |
| 797 |
} |
| 798 |
instance.calendarContainer |
| 799 |
.querySelectorAll(".flatpickr-day.selected") |
| 800 |
.forEach(el => { |
| 801 |
if (!el.classList.contains("startRange")) { |
| 802 |
el.classList.add("startRange"); |
| 803 |
} |
| 804 |
}); |
| 805 |
}, 0); |
| 790 |
} |
806 |
} |
| 791 |
// Range set, update hidden fields and set available items |
807 |
// Range set, update hidden fields and set available items |
| 792 |
else if (selectedDates[0] && selectedDates[1]) { |
808 |
else if (selectedDates[0] && selectedDates[1]) { |
| 793 |
- |
|
|