My calendar starts on day view (today) with appointments loaded. These appointments are grouped in a "booking package" where multiple appointments relate to a single booking.
For navigating around the calendar, it's useful to have a month view accessible but for that view, it isn't practical to have events loaded by appointment; it'd be better to load appointments by booking (each booking having several appointment events).
I'm rendering my calendar with a custom button per documentation (unedited, I've just copied the code in there as a placeholder):
const calendarEl = document.querySelector("#calendar");
let calendar = new FullCalendar.Calendar(calendarEl, {
....
customButtons: {
myCustomButton: {
text: 'month',
click: function () {
// Change event source for the calendar to show bookings in this view.
alert('clicked the custom button!')
}
}
}
....
})
How would I change the events the calendar renders (and change them back when the calendar goes back into the day view)?