# Titanium.Calendar.Event
An object that represents a single event in a calendar.
# Overview
The API supports retrieving information about existing events and creating new events. On iOS, existing events can be modified or deleted. On Android, only recurrence rules can be modified.
See Titanium.Calendar for examples of retrieving event information and creating events.
# Properties
# alerts
Alarms associated with the calendar item, as an array of Titanium.Calendar.Alert objects.
This property is read-only on Android.
# allDay
Indicates whether this event is all day.
This property is read-only on Android.
Default: false
# attendees READONLY
The list of event attendees. This list will be empty if the event has no attendees.
# availability
Availability of this event.
# isDetached READONLY
Boolean value that indicates whether an event is a detached instance of a repeating event.
This value is YES
if and only if the event is part of a repeating event
and one or more of its attributes have been modified from the repeating event's
default attributes.
# recurrenceRules
The recurrence rules for the calendar item.
On Android, only the first element of the recurrenceRules is taken into account due to the way it handles conditions for recurrence rules.
# reminders READONLY
Existing reminders for this event.
# status READONLY
Status of this event.
# visibility READONLY
Visibility of this event.
# Methods
# addRecurrenceRule
Adds a recurrence rule to the recurrence rule array.
Parameters
Name | Type | Description |
---|---|---|
rule | Titanium.Calendar.RecurrenceRule | The recurrence rule to be added. |
Returns
- Type
- void
# createAlert
Creates an alert for this event.
Parameters
Name | Type | Description |
---|---|---|
data | Dictionary<Titanium.Calendar.Alert> | Properties for the alert. |
Returns
# createRecurrenceRule
Creates an recurrence pattern for a recurring event. All of the properties for the recurrence rule must be set during creation. The recurrence rule properties cannot be modified.
Parameters
Name | Type | Description |
---|---|---|
data | Dictionary<Titanium.Calendar.RecurrenceRule> | Properties for the recurrence rule. |
Returns
# createReminder
Creates a reminder for this event.
Parameters
Name | Type | Description |
---|---|---|
data | Dictionary<Titanium.Calendar.Reminder> | Properties for the reminder. |
Returns
# getExtendedProperty
Gets the value of the specified extended property.
Parameters
Name | Type | Description |
---|---|---|
name | String | Name of an existing extended property. |
Returns
- Type
- String
# refresh
Updates the event's data with the current information in the Calendar database.
This method should be only used on events that your application is editing, and only when your application receives the change notification. If this method returns NO, the event has been deleted or otherwise invalidated, and you should not continue to use it.
Returns
- Type
- Boolean
# remove
Removes an event from the event store.
This method raises an exception if it is passed an event from another event store.
Parameters
Name | Type | Description |
---|---|---|
span | Number | The span to use. Indicates whether to remove future instances of the event in the case of a recurring event. |
Returns
- Type
- Boolean
# removeRecurrenceRule
Removes a recurrence rule to the recurrence rule array.
Parameters
Name | Type | Description |
---|---|---|
rule | Titanium.Calendar.RecurrenceRule | The recurrence rule to be removed. |
Returns
- Type
- void
# save
Saves changes to an event permanently.
This method raises an exception if it is passed an event from another event store.
When an event is saved, it is updated in the Calendar database. Any fields you did not modify are updated to reflect the most recent value in the database. If the event has been deleted from the database, it is re-created as a new event.
On Android, this method only updates the recurrence rule (if set). See TIMOB-24248 to track this new feature.
Parameters
Name | Type | Description |
---|---|---|
span | Number | The span to use. Indicates whether the save affects future instances of the event in the case of a recurring event. |
Returns
- Type
- Boolean
# setExtendedProperty
Sets the value of the specified extended property.
Parameters
Name | Type | Description |
---|---|---|
name | String | Property name. |
value | String | Property value. |
Returns
- Type
- void