# Titanium.Calendar.Event

An object that represents a single event in a calendar.

Availability
3.2.0
3.1.0
9.2.0

# 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

Availability
3.2.0
3.1.0
9.2.0
alerts :Array<Titanium.Calendar.Alert>

Alarms associated with the calendar item, as an array of Titanium.Calendar.Alert objects.

This property is read-only on Android.


# allDay

Availability
3.2.0
3.1.0
9.2.0
allDay :Boolean

Indicates whether this event is all day.

This property is read-only on Android.

Default: false


# apiName READONLY

Availability
3.2.0
3.2.0
9.2.0
apiName :String

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Titanium.UI.Button returns Ti.UI.Button.


# attendees READONLY

Availability
6.0.0
9.2.0
attendees :Array<Titanium.Calendar.Attendee>

The list of event attendees. This list will be empty if the event has no attendees.


# availability

Availability
3.1.0
9.2.0
availability :Number

Availability of this event.


# begin

Availability
3.2.0
3.1.0
9.2.0
begin :Date

Start date/time of this event.

This property is read-only on Android.


# bubbleParent

Availability
3.2.0
3.1.0
9.2.0
bubbleParent :Boolean

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

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true


# description READONLY

Availability
3.2.0
description :String

Description of this event.


# end

Availability
3.2.0
3.1.0
9.2.0
end :Date

End date/time of this event.

This property is read-only on Android.


# extendedProperties READONLY

Availability
3.2.0
extendedProperties :Dictionary

Extended properties of this event.


# hasAlarm READONLY

Availability
3.2.0
3.1.0
9.2.0
hasAlarm :Boolean

Indicates whether an alarm is scheduled for this event.


# id READONLY

Availability
3.2.0
3.1.0
9.2.0
id :String

Identifier of this event.


# isDetached READONLY

Availability
3.1.0
9.2.0
isDetached :Boolean

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.


# lifecycleContainer

Availability
3.6.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.


# location

Availability
3.2.0
3.1.0
9.2.0
location :String

Location of this event.

This property is read-only on Android.


# notes

Availability
3.1.0
9.2.0
notes :String

Notes for this event.


# recurrenceRules

Availability
7.1.0
3.1.0
9.2.0
recurrenceRules :Array<Titanium.Calendar.RecurrenceRule>

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

Availability
3.2.0
reminders :Array<Titanium.Calendar.Reminder>

Existing reminders for this event.


# status READONLY

Availability
3.2.0
3.1.0
9.2.0
status :Number

Status of this event.


# title

Availability
3.2.0
3.1.0
9.2.0
title :String

Title of this event.

This property is read-only on Android.


# visibility READONLY

Availability
3.2.0
visibility :Number

Visibility of this event.

# Methods

# addEventListener

Availability
3.2.0
3.1.0
9.2.0
addEventListener(name, callback) void

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

Parameters

Name Type Description
name String

Name of the event.

callback Callback<Titanium.Event>

Callback function to invoke when the event is fired.

Returns

Type
void

# addRecurrenceRule

Availability
3.1.0
9.2.0
addRecurrenceRule(rule) void

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

# applyProperties

Availability
3.2.0
3.1.0
9.2.0
applyProperties(props) void

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

Parameters

Name Type Description
props Dictionary

A dictionary of properties to apply.

Returns

Type
void

# createAlert

Availability
3.2.0
3.1.0
9.2.0
createAlert(data) Titanium.Calendar.Alert

Creates an alert for this event.

Parameters

Name Type Description
data Dictionary<Titanium.Calendar.Alert>

Properties for the alert.

Returns


# createRecurrenceRule

Availability
7.1.0
3.1.0
9.2.0
createRecurrenceRule(data) Titanium.Calendar.RecurrenceRule

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

Availability
3.2.0
createReminder(data) Titanium.Calendar.Reminder

Creates a reminder for this event.

Parameters

Name Type Description
data Dictionary<Titanium.Calendar.Reminder>

Properties for the reminder.

Returns


# fireEvent

Availability
3.2.0
3.1.0
9.2.0
fireEvent(name[, event]) void

Fires a synthesized event to any registered listeners.

Parameters

Name Type Description
name String

Name of the event.

event Dictionary

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

Returns

Type
void

# getExtendedProperty

Availability
3.2.0
getExtendedProperty(name) String

Gets the value of the specified extended property.

Parameters

Name Type Description
name String

Name of an existing extended property.

Returns

Type
String

# refresh

Availability
3.1.0
9.2.0
refresh() Boolean

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

Availability
12.4.0
3.1.0
9.2.0
remove(span) Boolean

Removes an event from the calendar.

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

Parameters

Name Type Description
span Number

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

Returns

Type
Boolean

# removeEventListener

Availability
3.2.0
3.1.0
9.2.0
removeEventListener(name, callback) void

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

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Parameters

Name Type Description
name String

Name of the event.

callback Callback<Titanium.Event>

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

Returns

Type
void

# removeRecurrenceRule

Availability
3.1.0
9.2.0
removeRecurrenceRule(rule) void

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

Availability
7.1.0
3.1.0
9.2.0
save(span) Boolean

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

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

Availability
3.2.0
setExtendedProperty(name, value) void

Sets the value of the specified extended property.

Parameters

Name Type Description
name String

Property name.

value String

Property value.

Returns

Type
void