This is a problem with several parts. Here is the basic idea.
- Allow user to click + drag selection using
selectable: true - In the
select callback, add a background event with addEventSource . - When adding an event, give it a custom property:
block: true . - Use a special function for
selectOverlap , which returns false if event.block.
Something like JSFiddle .
selectable: true, select: function (start, end, jsEvent, view) { $("#calendar").fullCalendar('addEventSource', [{ start: start, end: end, rendering: 'background', block: true, }, ]); $("#calendar").fullCalendar("unselect"); }, selectOverlap: function(event) { return ! event.block; }
Background events are optional, but this is usually desirable (visually).
If you want to drag already created events, you can use the selectOverlap function in eventOverlap .
source share