Date picker: Is it possible to limit the date picker so a user cannot choose today’s date and can only choose a future date. i.e. Today is July 5th, but a user can only book July 6th onward.
Time picker: Is it possible to limit the selectable time to working hours (8am-6pm)
For date picker set ‘Show text on load’ to ‘Placeholder text’ or ‘Nothing’
Then run this function under your onReady function:
$w.onReady(function () {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth();
var yyyy = today.getFullYear();
let badDate1 = new Date(yyyy, mm, dd);
$w("#datePicker1").disabledDates = [badDate1];
});
I’m not sure about TimePicker but I would just use a Dropdown and set the options to be between 8am to 6pm.
Thank you for your quick reply!
This does disable “today’s date” which is awesome!
However, I also need to block off weekends (Saturday and Sunday). This code seems to conflict with that. In the second image you will see Sunday is still selectable and it should not be.
Any ideas?