DayPilot.DatePicker.onTimeRangeSelect

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 date

  • args.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

DayPilot.DatePicker.select()

DayPilot.DatePicker.target

DayPilot.DatePicker Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript