logo

FullCalendar

This version is a pre-release. Read the release notes
requires Scheduler lightning bolt

Resource::getEvents

Retrieves a list of Event Objects that are associated with the given resource.

resource.getEvents()

Example:

var calendar = new Calendar(calendarEl, {
  resources: [
    { id: 'a', title: 'Resource A' },
    { id: 'b', title: 'Resource B' }
  ],
  events: [
    { title: 'Event 1', start: '2020-06-01', resourceId: 'a' },
    { title: 'Event 2', start: '2020-06-01', resourceId: 'a' },
    { title: 'Event 3', start: '2020-06-01', resourceId: 'b' }
  ]
});

var resourceA = calendar.getResourceById('a');
var events = resourceA.getEvents();
var eventTitles = events.map(function(event) { return event.title });

console.log(eventTitles); // [ 'Event 1', 'Event 2' ]