Lines 784-798
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
784 |
instance, |
784 |
instance, |
785 |
dayElem |
785 |
dayElem |
786 |
) { |
786 |
) { |
787 |
const currentDate = dayElem.dateObj |
787 |
const currentDate = dayElem.dateObj; |
|
|
788 |
const dateString = currentDate |
788 |
.toISOString() |
789 |
.toISOString() |
789 |
.split("T")[0]; |
790 |
.split("T")[0]; |
790 |
|
791 |
|
791 |
if (bookingsByDate[currentDate]) { |
792 |
// Make closed days unclickable (while keeping them part of the range) |
|
|
793 |
if (currentDate.getDay() === 0 || currentDate.getDay() === 6) { |
794 |
dayElem.classList.add("closed-day"); |
795 |
|
796 |
// Remove the click event to disable the day |
797 |
dayElem.addEventListener('click', function(event) { |
798 |
event.stopImmediatePropagation(); |
799 |
}, true); |
800 |
} |
801 |
|
802 |
if (bookingsByDate[dateString]) { |
792 |
const dots = document.createElement("span"); |
803 |
const dots = document.createElement("span"); |
793 |
dots.className = "event-dots"; |
804 |
dots.className = "event-dots"; |
794 |
dayElem.appendChild(dots); |
805 |
dayElem.appendChild(dots); |
795 |
bookingsByDate[currentDate].forEach(item => { |
806 |
bookingsByDate[dateString].forEach(item => { |
796 |
const dot = document.createElement("span"); |
807 |
const dot = document.createElement("span"); |
797 |
dot.className = "event item_" + item; |
808 |
dot.className = "event item_" + item; |
798 |
dots.appendChild(dot); |
809 |
dots.appendChild(dot); |
799 |
- |
|
|