How to set endDate to tomorrow in litepicker.js
you can add a function for this.
function addDays(days) {
let result = new Date();
result.setDate(result.getDate() + days);
return result;
}
so the final code looks like this.
function addDays(days) {
let result = new Date();
result.setDate(result.getDate() + days);
return result;
}
const picker = new Litepicker({
element: document.getElementById('start-date'),
elementEnd: document.getElementById('end-date'),
singleMode: false,
allowRepick: true,
format: 'D MMMM YYYY',
startDate: new Date(),
endDate: addDays(1),
numberOfMonths: 1,
numberOfColumns: 1,
tooltipText: {
one: 'night',
other: 'nights'
},
tooltipNumber: (totalDays) => {
return totalDays - 1;
}
});
this should also take care of the changing month.