Lines 132-137
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
132 |
// Circulation rules update |
132 |
// Circulation rules update |
133 |
let leadDays = 0; |
133 |
let leadDays = 0; |
134 |
let trailDays = 0; |
134 |
let trailDays = 0; |
|
|
135 |
let greyDates = []; |
135 |
let boldDates = []; |
136 |
let boldDates = []; |
136 |
let issueLength; |
137 |
let issueLength; |
137 |
let renewalLength; |
138 |
let renewalLength; |
Lines 767-775
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
767 |
|
768 |
|
768 |
const maxDate = new Date(startDate.getTime()); |
769 |
const maxDate = new Date(startDate.getTime()); |
769 |
maxDate.setDate( |
770 |
maxDate.setDate( |
770 |
maxDate.getDate() + totalIssueLength |
771 |
maxDate.getDate() + |
|
|
772 |
totalIssueLength + |
773 |
parseInt(trailDays) |
771 |
); |
774 |
); |
772 |
|
775 |
|
|
|
776 |
// Apply disabled style to inclusive trailDays in maxDate |
777 |
for (let i = 0; i < trailDays; i++) { |
778 |
const greyDate = new Date( |
779 |
maxDate.getTime() |
780 |
); |
781 |
greyDate.setDate(greyDate.getDate() - i); |
782 |
greyDates.unshift(greyDate); |
783 |
} |
784 |
|
773 |
// Update the maxDate option of the flatpickr instance |
785 |
// Update the maxDate option of the flatpickr instance |
774 |
instance.set("maxDate", maxDate); |
786 |
instance.set("maxDate", maxDate); |
775 |
} |
787 |
} |
Lines 844-849
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
844 |
// Range not set, reset field options and flatPickr state |
856 |
// Range not set, reset field options and flatPickr state |
845 |
else { |
857 |
else { |
846 |
boldDates = []; |
858 |
boldDates = []; |
|
|
859 |
greyDates = []; |
847 |
instance.set("maxDate", null); |
860 |
instance.set("maxDate", null); |
848 |
$("#booking_item_id > option").each( |
861 |
$("#booking_item_id > option").each( |
849 |
function () { |
862 |
function () { |
Lines 907-912
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
907 |
dayElem.classList.add("title"); |
920 |
dayElem.classList.add("title"); |
908 |
} |
921 |
} |
909 |
|
922 |
|
|
|
923 |
const isGreyed = greyDates.some( |
924 |
greyDate => |
925 |
greyDate.getTime() === currentDate.getTime() |
926 |
); |
927 |
if (isGreyed) { |
928 |
dayElem.classList.add("booking-grey"); |
929 |
} |
930 |
|
910 |
if (bookingsByDate[dateString]) { |
931 |
if (bookingsByDate[dateString]) { |
911 |
const dots = document.createElement("span"); |
932 |
const dots = document.createElement("span"); |
912 |
dots.className = "event-dots"; |
933 |
dots.className = "event-dots"; |
913 |
- |
|
|