Litepicker
Litepicker copied to clipboard
If day before lockedDay is available, allow lockedDay as date2
var lockedDates = [];
for(var i = 0, len = response.length; i < len; i++){
let lockDate = response[i].staydate;
lockedDates.push(lockDate);
}
let input = document.getElementById(response[0].room + '-availabledates');
const picker = new Litepicker ({
singleMode: false,
inlineMode: true,
numberOfMonths: 2,
numberOfColumns: 2,
format: "MM-DD-YYYY",
element: input,
lockDays: lockedDates,
disallowLockDaysInRange: true,
setup: function (picker) {
picker.on('selected', function (date1, date2) {
document.getElementById(response[0].room + '-chosendates').innerHTML = '<span>Check-In: ' + date1.format('MM-DD-YYYY') + ' Check-Out: ' + date2.format('MM-DD-YYYY' + '</span>');
})
}
})
}
I am new to coding and VERY new to litepicker. I have googled around a bit and can't seem to find many good examples for this issue.
If a day is locked, and the day before it is available. How can I allow that particular locked date to be date2.
Without allowing it to be selected within a range or as date1. Reading through the documentation on the site, it seems there used to be a hotelMode, and that seems to be exactly what I am looking for.