Skip to content

fetchCalendarObjects

get all/specified calendarObjects of the passed in calendar

const objects = await fetchCalendarObjects({
calendar: calendars[0],
headers: {
authorization: 'Basic x0C9uFWd9Vz8OwS0DEAtkAlj',
},
});
  • calendar required, DAVCalendar to fetch calendar objects from
  • objectUrls calendar object urls to fetch
  • filters CALDAV filter element in ElementCompact form
  • timeRange time range in iso format
    • start start time in ISO 8601 format, format that’s not in ISO 8601 will cause an error be thrown.
    • end end time in ISO 8601 format, format that’s not in ISO 8601 will cause an error be thrown.
    • start must be earlier than end.
  • headers request headers
  • headersToExclude array of keys of the headers you want to exclude
  • fetchOptions options to pass to underlying fetch function
  • fetch custom fetch implementation
  • urlFilter default: function which only keeps .ics objects predicate function to filter urls from the calendar objects before fetching
  • expand whether to expand recurring components into individual instances. Requires timeRange; requests without it reject.
  • useMultiGet default: true whether to use calendarMultiGet as underlying function to fetch calendar objects; if set to false, uses a single calendarQuery request instead.

array of DAVCalendarObject

a mix of calendarMultiGet and calendarQuery, you can specify both filters and objectUrls here.

The default query selects VEVENT resources. For a complete collection snapshot, pass filters: { "comp-filter": { _attributes: { name: "VCALENDAR" } } } and a urlFilter that accepts every object URL except the collection URL, including extensionless resources. Built-in calendar sync and account loading use this complete query.