React Scheduler - Occurrences
An Occurrence is an appointment instance that falls within a specified time interval. A non-recurring appointment maps to one occurrence. A recurring appointment can generate multiple occurrences.
To obtain an occurrence list, call the getOccurrences(startDate, endDate, appointments) method. Pass startDate, endDate, and the appointment array.
You may need this method in the following scenarios:
Detect Overlapping Appointments
Use the following function to prevent appointment time conflicts when users create or edit appointments. The function checks if a candidate interval intersects with any occurrence in the selected day.
function hasOverlap(scheduler, candidate) {
const dayStart = new Date(candidate.startDate);
dayStart.setHours(0, 0, 0, 0);
const dayEnd = new Date(dayStart);
dayEnd.setDate(dayEnd.getDate() + 1);
const allAppointments = scheduler.getDataSource().items();
const occurrences = scheduler.getOccurrences(dayStart, dayEnd, allAppointments);
return occurrences.some((item) =>
item.startDate < candidate.endDate && candidate.startDate < item.endDate
);
}Export Appointment Occurrences within the Specified Date Interval
Use the following code snippet when you need to export events that fall within the specified date/time interval. The mapped array converts occurrences to a flat structure suitable for CSV, Excel, or API payloads.
const visibleStart = new Date(2026, 3, 1);
const visibleEnd = new Date(2026, 3, 2);
const appointments = scheduler.getDataSource().items();
const occurrences = scheduler.getOccurrences(visibleStart, visibleEnd, appointments);
const exportRows = occurrences.map((item) => ({
Subject: item.appointmentData.text,
Start: item.startDate.toISOString(),
End: item.endDate.toISOString()
}));