DayPilot.Column.events.forRange

The forRange() method returns an array of events displayed in a given column of the JavaScript Calendar component that overlap the specified time range.

You can use it to find events displayed in a calendar cell or in a custom range.

Declaration

DayPilot.Column.events.forRange(start, end)

Parameters

  • start (DayPilot.Date or string in ISO 8601 format) - start date/time

  • end (DayPilot.Date or string in ISO 8601 format) - end date/time

Return Value

Returns an array of DayPilot.Event objects.

Notes

The result includes events that overlap the specified date/time range by at least one millisecond.

Use columns.find() on a DayPilot.Calendar instance to get the column object for a specific column before calling this method.

Example

const dp = new DayPilot.Calendar("dp", {
  // ...
});
dp.init();

const events = dp.columns.find(DayPilot.Date.today(), "A").events.forRange(DayPilot.Date.today().addHours(10), DayPilot.Date.today().addHours(15));

See Also

DayPilot.Column.events.all()

DayPilot.Column.events.isEmpty()

DayPilot.Column.events.totalDuration()

DayPilot.Column Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript