events from an iCalendar feed
FullCalendar can display events from a public iCalendar feed. This functionality is available as of v5.5.0
.
First, install the @fullcalendar/icalendar
package:
npm install --save @fullcalendar/icalendar
Then, initialize your calendar with the plugin. Use the events
option to provide an event source that contains a url
property and a format:'ics'
property:
import dayGridPlugin from '@fullcalendar/daygrid'
import iCalendarPlugin from '@fullcalendar/icalendar'
var calendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin, iCalendarPlugin],
events: {
url: 'https://mywebsite/icalendar-feed.ics',
format: 'ics'
}
})
calendar.render()
Your iCalendar feed will be queried upon calendar load and will not be queried after. Unlike a json feed, the URL will not be queried when the user navigates forward or backward in time.
The URL will be requeried when the refetchEvents or EventSource::refetch methods are called.