Returns all available calendars from the device’s native Calendar application. If needed, a permission pop-up for the user to grant calendar access is presented first.
Syntax
1import { getCalendarService } from 'lightning/mobileCapabilities';2getCalendars(options: CalendarServiceOptions): Promise<Object>
Parameters
options—(Required) A CalendarServiceOptions object to configure the CalendarService request.
Returns
A Promise object that resolves as an array of Calendar objects. If an error is encountered, the array is empty.
Usage
Use this function to make device calendars available for use with CalendarService.
This function is a prerequisite for using any other CalendarService functionality; in other words, this function must be called before any other CalendarService function, except for getCalendarService().
If an error occurs, the error is returned via a rejected promise. Handle errors in a catch clause.
Release Preview
This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.