The onTimeRangeSelect event handler fires when the user selects a time range using drag and drop in the monthly calendar component.
You can use it to create a new event.
DayPilot.Month.onTimeRangeSelect(args)args.start (DayPilot.Date) - selection start
args.end (DayPilot.Date) - selection end
args.preventDefault() - cancels the default action
This event fires before the default action. For time range selection, there is no default action, so it is equivalent to DayPilot.Month.onTimeRangeSelected. Related handling options are configured using DayPilot.Month.timeRangeSelectedHandling.
JavaScript
const month = new DayPilot.Month("dp", {
onTimeRangeSelect: (args) => {
console.log(args.start, args.end);
},
// ...
});
month.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onTimeRangeSelect: (args) => {
console.log(args.start, args.end);
},
// ...
};React
<DayPilotMonth
onTimeRangeSelect={onTimeRangeSelect}
{/* ... */}
/>const onTimeRangeSelect = (args) => {
console.log(args.start, args.end);
};Vue
<DayPilotMonth
@timeRangeSelect="onTimeRangeSelect"
<!-- ... -->
/>const onTimeRangeSelect = (args) => {
console.log(args.start, args.end);
};Event Creation [doc.daypilot.org]
DayPilot.Month.onTimeRangeSelected