Skip to content
Titanium SDK
Version12.6.2

You are reading 12.6.2. See this page in 13.4.1.

Titanium.Calendar.Event

proxyAndroidiPhoneiPadmacOSsince Android 3.2.0, iPhone 3.1.0, iPad 3.1.0

Extends Titanium.Proxy

An object that represents a single event in a calendar.

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 21

allDay

Boolean

Indicates whether this event is all day.

This property is read-only on Android.

Default: false

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

begin

Date

Start date/time of this event.

This property is read-only on Android.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

description

StringAndroidread-only

Description of this event.

end

Date

End date/time of this event.

This property is read-only on Android.

hasAlarm

Booleanread-only

Indicates whether an alarm is scheduled for this event.

id

Stringread-only

Identifier of this event.

isDetached

BooleaniPhoneiPadmacOSread-only

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.

location

String

Location of this event.

This property is read-only on Android.

notes

StringiPhoneiPadmacOS

Notes for this event.

recurrenceRules

Array<Titanium.Calendar.RecurrenceRule>since Android 7.1.0, iPhone 3.1.0, iPad 3.1.0

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.

title

String

Title of this event.

This property is read-only on Android.

Methods 14

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Gets the value of the specified extended property.

Parameters
ParametersTypeDescription
nameString

Name of an existing extended property.

Returns String

refresh

iPhoneiPadmacOS

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 Boolean

remove

since Android 12.4.0, iPhone 3.1.0, iPad 3.1.0, macOS 9.2.0

Removes an event from the calendar.

This method raises an exception on iOS if an event from another calendar is used.

Parameters
ParametersTypeDescription
spanNumber

iOS-only: The span to use. Indicates whether to remove future instances of the event in the case of a recurring event.

Returns Boolean

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

save

since Android 7.1.0, iPhone 3.1.0, iPad 3.1.0

Saves changes to an event permanently.

This method raises an exception if it is passed an event from another calendar.

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
ParametersTypeDescription
spanNumber

The span to use. Indicates whether the save affects future instances of the event in the case of a recurring event.

Returns Boolean

Sets the value of the specified extended property.

Parameters
ParametersTypeDescription
nameString

Property name.

valueString

Property value.