I'm creating a form with Fluentforms and it has inside a datetime field.
I would like to allow users to pick a date only 17 hours before the "departure".
So I need something like today + 17hours.
At first I've added today + 2 days
{
minDate: new Date().fp_incr(2)
}
But my client wants it + 17 hours.
I have seen that on flatpickr I should be able to use hourIncrement but i'm not really sure how to use it exactly.
I have tried also with this code but it's not working
function addHours(date, hours) {
const hoursToAdd = hours * 60 * 60 * 1000;
date.setTime(date.getTime() + hoursToAdd);
return date;
}
var newDate = addHours(new Date(),17);
Can someone please help me?