I am using fullcalendar's resource-daygrid
on an event, and I'm trying to add a range.
Let say the event starts on Jan 12, 2021 and ends on Jan 15, 2021. Then I would like to show only this range and not allow clicking previous or next dates.
Currently I am using this code:
const calendarElement = document.getElementById("programme");
let calendar = new Calendar(calendarElement, {
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
locale: nlLocale,
timeZone: "UTC",
plugins: [
resourceDayGridPlugin,
],
initialView: 'resourceDayGridDay',
resources: `${window.location.href}/getRoomsJSON`,
eventDisplay: 'block',
headerToolbar: {
start: 'title,prev,next',
center: '',
end: ''
},
visibleRange: {
start: '2020-01-12',
end: '2020-01-15'
},
events: [
{ id: '1', resourceId: '2', start: '2020-01-12T12:00:00', title: 'event 1' },
{ id: '2', resourceId: '2', start: '2020-01-12T12:00:00', title: 'event 2' },
{ id: '3', resourceId: '3', start: '2020-01-12T12:00:00', title: 'event 4' },
{ id: '4', resourceId: '4', start: '2020-01-12T12:30:00', title: 'event 5' }
]
});
calendar.render();
It looks like the visibleRange
is ignored since this doesn't seem to do anything at all. I also won't get console errors.
Any ideas on this?