I am working on building a date picker using the litepicker.js I have everything working so far but got stumped on getting the endDate to load tomorrows date. Here is what I currently have.
new Litepicker({
element: document.getElementById('start-date'),
elementEnd: document.getElementById('end-date'),
singleMode: false,
allowRepick: true,
format: 'D MMMM YYYY',
startDate: new Date(),
endDate: new Date(),
numberOfMonths: 1,
numberOfColumns: 1,
tooltipText: {
one: 'night',
other: 'nights'
},
tooltipNumber: (totalDays) => {
return totalDays - 1;
}
});
This will show todays date on both fields, however I want the endDate to be tomorrow instead. I have tried the following
endDate: new Date(startDate.getTime() + 86400000)
and a couple other failed attempts but to no avail. Hoping the masses can assist.
Thanks in advance.