Module: calendar

Members

(static) config

Properties:
Name Type Description
config
Source:

(static) RRule :RRule

RRule instance
Type:
  • RRule
Source:

Methods

(static) createCalendar(opt) → {String}

Create a calendar.
Parameters:
Name Type Description
opt Object
Source:
Returns:
The calendar ID.
Type
String

(static) createEvent(calendar, opt) → {String}

Create an event in calendar
Parameters:
Name Type Description
calendar Ti.Calendar.Calendar The calendar object
opt Object Event properties. All properties are inherithed by Titanium.Calendar.Event
Properties
Name Type Attributes Description
recurrenceRule Object <optional>
An optional recurrence rule.
alerts Object <optional>
An array of alerts.
Source:
Returns:
Event ID
Type
String

(static) deleteCalendar(Calendar) → {Boolean}

Delete a calendar
Parameters:
Name Type Description
Calendar Ti.Calendar object
Source:
Returns:
Type
Boolean

(static) deleteCalendarById(id) → {Boolean}

Delete a calendar by its ID
Parameters:
Name Type Description
id String The ID
Source:
Returns:
Type
Boolean

(static) deleteEvent(event) → {Boolean}

Delete an event by its ID.
Parameters:
Name Type Description
event Ti.Calendar.Event The event.
Source:
Returns:
Type
Boolean

(static) getAlerts(event) → {Array}

Get the alerts for the event.
Parameters:
Name Type Description
event Ti.Calendar.Event
Source:
Returns:
alerts
Type
Array

(static) getAllCalendars() → {Array.<Ti.Calendar.Calendar>}

Retrieve all calendars.
Source:
Returns:
Type
Array.<Ti.Calendar.Calendar>

(static) getCalendarById(id) → {Ti.Calendar.Calendar}

Get a calendar by its ID.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Ti.Calendar.Calendar

(static) getDefaultCalendar() → {Ti.Calendar.Calendar}

Get the default calendar for adding new events.
Source:
Returns:
Type
Ti.Calendar.Calendar

(static) getEventById(calendar, id) → {Ti.Calendar.Event}

Retrieve an event by its ID
Parameters:
Name Type Description
calendar Ti.Calendar.Calendar The calendar object
id String The ID
Source:
Returns:
Type
Ti.Calendar.Event

(static) getEventsBetweenDates(cal, d1, d2) → {Array.<Ti.Calendar.Event>}

Get the events of a calendar between two dates.
Parameters:
Name Type Description
cal Ti.Calendar.Calendar
d1 Object The date from
d2 Object The date to
Source:
Returns:
Type
Array.<Ti.Calendar.Event>

(static) getEventsInDate(cal, year, month, day) → {Array.<Ti.Calendar.Event>}

Get the events of a calendar in a specified date.
Parameters:
Name Type Description
cal Ti.Calendar.Calendar
year Number
month Number
day Number
Source:
Returns:
Type
Array.<Ti.Calendar.Event>

(static) getEventsInMonth(cal, year, month) → {Array.<Ti.Calendar.Event>}

Get the events of a calendar in a month.
Parameters:
Name Type Description
cal Number
year Number
month Number
Source:
Returns:
Type
Array.<Ti.Calendar.Event>

(static) getEventsInYear(cal, year) → {Array.<Ti.Calendar.Event>}

Get the events of a calendar in a year.
Parameters:
Name Type Description
cal Number
year Number
Source:
Returns:
Type
Array.<Ti.Calendar.Event>

(static) getOrCreateAppCalendar() → {Ti.Calendar.Calendar}

Get or create a Calendar that can be used by the application without dirtying other calendars. The calendar ID object is saved in a persistent storage that will be deleted when the app will be uninstalled, so take care of your ID. The calendar name is automatically set by application name.
Source:
Returns:
Type
Ti.Calendar.Calendar

(static) getRecurrenceRule(event) → {calendar.RRule}

Get a recurrence rule instance for an event
Parameters:
Name Type Description
event Ti.Calendar.Event
Source:
Returns:
Type
calendar.RRule

(static) requestPermissions(success, error)

Request the permissions to use calendars functions.
Parameters:
Name Type Description
success function
error function
Source:

(static) setAlerts(event, alerts) → {Ti.Calendar.Event}

Set the alerts for the event. Each alert specifies how many minutes in advance the user will receive the notification (must be positive)
Parameters:
Name Type Description
event Ti.Calendar.Event
alerts Array
Source:
Returns:
Type
Ti.Calendar.Event

(static) setRecurrenceRule(event, rule)

Set a recurrence rule for the event. Multiple recurrences are not supported for platform parity.
Parameters:
Name Type Description
event Ti.Calendar.Event The event.
rule Object An object with recurrence rule.
Source: