DayPilot.Month.onTimeRangeSelected

The onTimeRangeSelected event handler is fired by the monthly calendar component when a user selects a time range using drag and drop.

You can use it to create a new event.

This event is fired after the default action. In case on time range selection, there is no default action so it is an equivalent of onTimeRangeSelect event.

Declaration

DayPilot.Month.onTimeRangeSelected(args)

Parameters

Example

// event creating
onTimeRangeSelected: (args) => {
    var name = prompt("New event name:", "Event");
    dp.clearSelection();
    if (!name) return;
    dp.events.add({
        start: start,
        end: end,
        id: DayPilot.guid(),
        text: "Event"
    });
    dp.message("Created");
}

api=1

See also DayPilot.Month.api.

Declaration

onTimeRangeSelected(start, end, resource)

Parameters

  • start (DayPilot.Date) - start of the selected range

  • end (DayPilot.Date) - end of the selected range

  • resource (string) - id of the resource