CalendarEvent
Manages events in calendars.
Used for creating, fetching and removing events from your calendars.
Properties
Section titled “Properties”attendees
Section titled “attendees”Attendees associated with the event.
attendees: [any]An array of objects on the following form:
{ "isCurrentUser": false, "name": "John Appleseed", "status": "accepted", "type": "person", "role": "required"}Note that the property is read-only since iOS does not expose API to modify the attendees of an event.
Read-only.
availability
Section titled “availability”Availability during the event.
availability: stringIndicates how the event should be treated for scheduling purposes. The following values are supported:
- busy
- free
- tentative
- unavailable
Be aware that not all calendars support all of these availabilities and some calendars may not support availability at all. Use Calendar.supportsAvailability() to check if a calendar supports a specific availability.
calendar
Section titled “calendar”Calendar the event is stored in.
calendar: CalendarendDate
Section titled “endDate”End date of event.
endDate: Dateidentifier
Section titled “identifier”Identifier of event.
identifier: stringRead-only.
isAllDay
Section titled “isAllDay”Whether the event is an all-day event.
isAllDay: boollocation
Section titled “location”Location of event.
location: stringNotes associated with event.
notes: stringstartDate
Section titled “startDate”Start date of event.
startDate: DatetimeZone
Section titled “timeZone”Time zone of event.
timeZone: stringGeopolitical region identifier that identifies the time zone, e.g. “Europe/Copenhagen”, “America/New_York” and “Asia/Tokyo”.
Title of event.
title: stringMethods
Section titled “Methods”
new CalendarEvent()
Section titled “new CalendarEvent()”Constructs an event.
new CalendarEvent()In order to add the event to your calendar, you must call the save() function.
addRecurrenceRule(recurrenceRule)
Section titled “addRecurrenceRule(recurrenceRule)”Adds a recurrence rule.
addRecurrenceRule(recurrenceRule: RecurrenceRule)Recurrence rules specify when the eventer or reminder should be repeated. See the documentation of RecurrenceRule for more information on creating rules.
Parameters
Section titled “Parameters”recurrenceRule RecurrenceRule
Recurrence rule to add to the reminder.
between(startDate, endDate, calendars)
Section titled “between(startDate, endDate, calendars)”Events that occurs between two dates.
static between(startDate: Date, endDate: Date, calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”startDate Date
Start date to fetch events for.
endDate Date
End date to fetch events for.
calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
lastWeek(calendars)
Section titled “lastWeek(calendars)”Events that occurred last week.
static lastWeek(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
nextWeek(calendars)
Section titled “nextWeek(calendars)”Events that occur next week.
static nextWeek(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
presentCreate()
Section titled “presentCreate()”Presents a view for creating a calendar event.
static presentCreate(): Promise<CalendarEvent>The presented view supports editing various attributes of the event, including title, location, dates, recurrence and alerts.
Return value
Section titled “Return value”Promise<CalendarEvent>
Promise that provides the created event when fulfilled.
presentEdit()
Section titled “presentEdit()”Presents a view for editing the calendar event.
presentEdit(): Promise<CalendarEvent>The presented view supports editing various attributes of the event, including title, location, dates, recurrence and alerts.
Return value
Section titled “Return value”Promise<CalendarEvent>
Promise that provides the updated event when fulfilled.
remove()
Section titled “remove()”Removes event from calendar.
remove()
removeAllRecurrenceRules()
Section titled “removeAllRecurrenceRules()”Removes all recurrence rules.
removeAllRecurrenceRules()
save()
Section titled “save()”Saves event.
save()Saves changes to an event, inserting it into the calendar if it is newly created.
thisWeek(calendars)
Section titled “thisWeek(calendars)”Events that occur this week.
static thisWeek(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
today(calendars)
Section titled “today(calendars)”Events occurring today.
static today(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
tomorrow(calendars)
Section titled “tomorrow(calendars)”Events occurring tomorrow.
static tomorrow(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.
yesterday(calendars)
Section titled “yesterday(calendars)”Events that occurred yesterday.
static yesterday(calendars: [Calendar]): Promise<[CalendarEvent]>Parameters
Section titled “Parameters”calendars [Calendar]
Calendars to fetch events for. Defaults to all calendars.
Return value
Section titled “Return value”Promise<[CalendarEvent]>
Promise that provides the events when fulfilled.