Skip to main content
Version: 2.1.2

fetchCalendarObjects

fetchCalendarObjects

get all/specified calendarObjects of the passed in calendar

const objects = await fetchCalendarObjects({
calendar: calendars[0],
headers: {
authorization: 'Basic x0C9uFWd9Vz8OwS0DEAtkAlj',
},
});

Arguments

  • 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.
  • headers request headers
  • headersToExclude array of keys of the headers you want to exclude
  • fetchOptions options to pass to underlying fetch function
    info

    some calendar providers may return their objects with different suffix than .ics such as http://api.xx/97ec5f81-5ecc-4505-9621-08806f6796a3 or http://api.xx/calobj1.abc in this case, you need to pass in your own calendar object name filter so that you can have results you need.

  • urlFilter default: function which only keep .ics objects predicate function to filter urls from the calendar objects before fetching
  • expand whether to expand the calendar objects, forcing the server to expand recurring components into individual calendar objects.
    info

    some calendar providers may not support calendarMultiGet, then it's necessary to use calendarQuery to fetch calendar object data.

  • useMultiGet default: true whether to use calendarMultiGet as underlying function to fetch calendar objects, if set to false, it will use calendarQuery to fetch instead.

Return Value

array of DAVCalendarObject

Behavior

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