Utilize the selectOverlap feature in fullCalendar to control event overlapping during selection on the calendar for creating new events.
This setting can be toggled as either true
or false
. For more precise management, you can define a custom callback function that must return a boolean value indicating whether the selected overlap is permissible.
- When set to
true
(default), users can select any time period without restriction.
- A setting of
false
prevents selection of any time range that overlaps with an existing event.
- If using a custom callback function, the logic within the function determines the outcome.
An example provided in the documentation showcases the use of a callback:
var calendar = new Calendar(calendarEl, {
events: [ /* populate with event data */ ]
selectOverlap: function(event) {
return event.rendering === 'background';
}
});
This setup allows overlap only if the overlapping event is tagged as a background event, ensuring no overlap for other types of events.