isAvailable()

Use this function to determine whether CalendarService functionality is available.

Syntax 

1import { getCalendarService } from 'lightning/mobileCapabilities';
2isAvailable(): Boolean

Parameters 

None.

Returns 

Returns true when used on a supported device, and false otherwise.

Usage 

Use this function to disable or hide calendar-related features on platforms where calendars aren’t supported. For example:

1handleGetCalendarClick(event) {
2  const myCalendarService = getCalendarService();
3  if(myCalendarService.isAvailable()) {
4    // Perform calendar-related operations
5  }
6  else {
7    // CalendarService not available, or consuming app hasn’t implemented it
8    // Not running on a device with native calendar functionality, etc.
9    // Handle with message, error, beep, and so on
10  }
11}