Skip to content

Calendar

Access and manage iOS calendars and reminder lists

Calendar provides access to the user's calendars for both events and reminders. Requires calendar access permissions.

Use Calendar to:

Examples

javascript
let calendars = await Calendar.forEvents();
for (let cal of calendars) {
    console.log(cal.title);
}
javascript
let cal = await Calendar.createForReminders("Shopping");
console.log(cal.identifier);
javascript
let cal = await Calendar.findOrCreateForReminders("Work Tasks");
cal.color = Color.blue();
await cal.save();

Properties

identifier

  • Type: String

Unique identifier for this calendar

javascript
calendar.identifier

title

  • Type: String

Display title of the calendar

javascript
calendar.title

isSubscribed

  • Type: Bool

Whether this is a subscribed (read-only) calendar

javascript
calendar.isSubscribed

allowsContentModifications

  • Type: Bool

Whether modifications are allowed

javascript
calendar.allowsContentModifications

Methods

getColor

Get calendar color

typescript
getColor(): Color

Returns: Color object representing the calendar color

Example:

javascript
let color = calendar.color

setColorWithBridge

Set calendar color

typescript
setColorWithBridge(color): void
  • color - Color to set

Example:

javascript
calendar.color = Color.red()

supportsAvailability

Check if calendar supports an availability type

typescript
supportsAvailability(availability): boolean
  • availability - "busy", "free", "tentative", or "unavailable"

Returns: true if the availability type is supported

Example:

javascript
calendar.supportsAvailability("busy")

save

Save changes to this calendar

typescript
save(): void

Returns: Promise that resolves when saved

Example:

javascript
await calendar.save()

remove

Delete this calendar

typescript
remove(): void

Returns: Promise that resolves when removed

Example:

javascript
await calendar.remove()

forReminders

Get all reminder calendars (lists)

typescript
static forReminders(): void

Returns: Promise resolving to array of Calendar objects

Example:

javascript
let calendars = await Calendar.forReminders()

forEvents

Get all event calendars

typescript
static forEvents(): void

Returns: Promise resolving to array of Calendar objects

Example:

javascript
let calendars = await Calendar.forEvents()

forRemindersByTitle

Find a reminder calendar by title

typescript
static forRemindersByTitle(title): void
  • title - Calendar title to search for

Returns: Promise resolving to Calendar or error if not found

Example:

javascript
let cal = await Calendar.forRemindersByTitle("Shopping")

forEventsByTitle

Find an event calendar by title

typescript
static forEventsByTitle(title): void
  • title - Calendar title to search for

Returns: Promise resolving to Calendar or error if not found

Example:

javascript
let cal = await Calendar.forEventsByTitle("Work")

createForReminders

Create a new reminder calendar

typescript
static createForReminders(title): void
  • title - Title for the new calendar

Returns: Promise resolving to the new Calendar

Example:

javascript
let cal = await Calendar.createForReminders("My List")

findOrCreateForReminders

Find or create a reminder calendar

Returns existing calendar if found, otherwise creates a new one.

typescript
static findOrCreateForReminders(title): void
  • title - Calendar title

Returns: Promise resolving to Calendar

Example:

javascript
let cal = await Calendar.findOrCreateForReminders("Tasks")

defaultForReminders

Get the default reminder calendar

typescript
static defaultForReminders(): void

Returns: Promise resolving to the default Calendar

Example:

javascript
let cal = await Calendar.defaultForReminders()

defaultForEvents

Get the default event calendar

typescript
static defaultForEvents(): void

Returns: Promise resolving to the default Calendar

Example:

javascript
let cal = await Calendar.defaultForEvents()

presentPicker

Present a calendar picker UI

Shows a system calendar chooser dialog. Not available in widgets.

typescript
static presentPicker(allowMultiple): void
  • allowMultiple - Allow selecting multiple calendars

Returns: Promise resolving to array of selected Calendars

Example:

javascript
let selected = await Calendar.presentPicker(true)