|
Lines 773-778
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
| 773 |
|
773 |
|
| 774 |
// Update the maxDate option of the flatpickr instance |
774 |
// Update the maxDate option of the flatpickr instance |
| 775 |
instance.set("maxDate", maxDate); |
775 |
instance.set("maxDate", maxDate); |
|
|
776 |
|
| 777 |
// Re-apply startRange class after redraw |
| 778 |
// Flatpickr may lose this class when maxDate triggers a redraw |
| 779 |
setTimeout(() => { |
| 780 |
// Only apply if still in "start date only" state |
| 781 |
if (instance.selectedDates.length !== 1) { |
| 782 |
return; |
| 783 |
} |
| 784 |
instance.calendarContainer |
| 785 |
.querySelectorAll(".flatpickr-day.selected") |
| 786 |
.forEach(el => { |
| 787 |
if (!el.classList.contains("startRange")) { |
| 788 |
el.classList.add("startRange"); |
| 789 |
} |
| 790 |
}); |
| 791 |
}, 0); |
| 776 |
} |
792 |
} |
| 777 |
// Range set, update hidden fields and set available items |
793 |
// Range set, update hidden fields and set available items |
| 778 |
else if (selectedDates[0] && selectedDates[1]) { |
794 |
else if (selectedDates[0] && selectedDates[1]) { |
| 779 |
- |
|
|