The onTimeRangeSelect event handler fires when the user changes the selected date, before the target element is updated.
Declaration
DayPilot.DatePicker.onTimeRangeSelect(args)
Parameters
args.date(DayPilot.Date) - the selected dateargs.preventDefault()- cancels the default action and prevents the target element from being updated
Notes
Call args.preventDefault() when you need to keep the linked target element unchanged.
The DayPilot.DatePicker.select() method fires this event as well.
Example
const picker = new DayPilot.DatePicker({
target: "start",
onTimeRangeSelect: (args) => {
console.log(args.date.toString("yyyy-MM-dd"));
args.preventDefault();
},
// ...
});
picker.show();
See Also
DayPilot.DatePicker.onTimeRangeSelected
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot