The onTimeRangeSelect event handler fires when the user changes the selected date, before the target element is updated.
DayPilot.DatePicker.onTimeRangeSelect(args)
args.date (DayPilot.Date) - the selected date
args.preventDefault() - cancels the default action and prevents the target element from being updated
Call args.preventDefault() when you need to keep the linked target element unchanged.
The DayPilot.DatePicker.select() method fires this event as well.
const picker = new DayPilot.DatePicker({
target: "start",
onTimeRangeSelect: (args) => {
console.log(args.date.toString("yyyy-MM-dd"));
args.preventDefault();
},
// ...
});
picker.show();