Titanium.Calendar
> Titanium.Calendar

The Calendar module provides an API for accessing the native calendar functionality.

This module supports retrieving information about existing events and creating new events. Modifying or deleting existing events and creating recurring events are only supported on iOS.

Currently, on Android, calendar permissions must be explicitly configured in tiapp.xml in order to access the calendar. See "Common Requirements" in tiapp.xml and timodule.xml Reference.

Examples

All Calendars vs Selectable Calendars

Print the names of all calendars, and the names of calendars that have been selected in the native Android calendar application.

function showCalendars(calendars) {
    for (var i = 0; i < calendars.length; i++) {
        Ti.API.info(calendars[i].name);
    }
}

Ti.API.info('ALL CALENDARS:');
showCalendars(Ti.Calendar.allCalendars);
if (Ti.Platform.osname === 'android') {
    Ti.API.info('SELECTABLE CALENDARS:');
    showCalendars(Ti.Calendar.selectableCalendars);
}

Create an Event and Reminder on Android

Creates an event and adds an e-mail reminder for 10 minutes before the event.

var CALENDAR_TO_USE = 3;
var calendar = Ti.Calendar.getCalendarById(CALENDAR_TO_USE);

// Create the event
var eventBegins = new Date(2010, 11, 26, 12, 0, 0);
var eventEnds = new Date(2010, 11, 26, 14, 0, 0);
var details = {
    title: 'Do some stuff',
    description: "I'm going to do some stuff at this time.",
    begin: eventBegins,
    end: eventEnds
};

var event = calendar.createEvent(details);

// Now add a reminder via e-mail for 10 minutes before the event.
var reminderDetails = {
    minutes: 10,
    method: Ti.Calendar.METHOD_EMAIL
};

event.createReminder(reminderDetails);

Events in a year

Create a picker to allow an existing calendar to be selected and, when a button is clicked, generate details of all events in that calendar for the current year .

var calendars = [];
var selectedCalendarName;
var selectedid;
var pickerData = [];
var osname = Ti.Platform.osname;

//**read events from calendar*******
function performCalendarReadFunctions(){
    var scrollView = Ti.UI.createScrollView({
      backgroundColor: '#eee',
      height: 500,
      top: 20
    });

    var label = Ti.UI.createLabel({
      backgroundColor: 'white',
      text: 'Click on the button to display the events for the selected calendar',
      textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
      top: 20
    });
    scrollView.add(label);

    var selectableCalendars = Ti.Calendar.allCalendars;
    for (var i = 0, ilen = selectableCalendars.length; i < ilen; i++) {
      calendars.push({ name: selectableCalendars[i].name, id: selectableCalendars[i].id });
      pickerData.push( Ti.UI.createPickerRow({ title: calendars[i].name }) );
      if(i === 0){
        selectedCalendarName = selectableCalendars[i].name;
        selectedid = selectableCalendars[i].id;
      }
    }

    if(!calendars.length){
      label.text = 'No calendars available. Select at least one in the native calendar before using this app';
    } else {
      label.text = 'Click button to view calendar events';

      var picker = Ti.UI.createPicker({
        top:20
      });

      picker.add(pickerData);
      win.add(picker);

      picker.addEventListener('change', function(e){
        for (var i = 0, ilen = calendars.length; i < ilen; i++) {
          if(calendars[i].name === e.row.title){
            selectedCalendarName = calendars[i].name;
            selectedid = calendars[i].id;
            Ti.API.info('Selected calendar that we are going to fetch is :: '+ selectedid + ' name:' + selectedCalendarName);
          }
        }
      });

      var button = Ti.UI.createButton({
        title: 'View events',
        top: 20
      });
      win.add(button);

      button.addEventListener('click', function(e){
        label.text = 'Generating...';

        var currentYear = new Date().getFullYear();

        var consoleString = '';

        function print(s) {
          if (consoleString.length) {
            consoleString = consoleString + '\n';
          }
          consoleString = consoleString + s;
        }

        var calendar = Ti.Calendar.getCalendarById(selectedid);
        Ti.API.info('Calendar was of type' + calendar);
        Ti.API.info('calendar that we are going to fetch is :: '+ calendar.id + ' name:' + calendar.name);

        function printReminder(r) {
            if (osname === 'android') {
                var typetext = '[method unknown]';
                if (r.method == Ti.Calendar.METHOD_EMAIL) {
                    typetext = 'Email';
                } else if (r.method == Ti.Calendar.METHOD_SMS) {
                    typetext = 'SMS';
                } else if (r.method == Ti.Calendar.METHOD_ALERT) {
                    typetext = 'Alert';
                } else if (r.method == Ti.Calendar.METHOD_DEFAULT) {
                    typetext = '[default reminder method]';
                }
                print(typetext + ' reminder to be sent ' + r.minutes + ' minutes before the event');
            }
        }

        function printAlert(a) {
            if (osname === 'android') {
                  print('Alert id ' + a.id + ' begin ' + a.begin + '; end ' + a.end + '; alarmTime ' + a.alarmTime + '; minutes ' + a.minutes);
            } else if (osname === 'iphone' || osname === 'ipad') {
                print('Alert absoluteDate ' + a.absoluteDate + ' relativeOffset ' + a.relativeOffset);
            }
        }

        function printEvent(event) {
          if (event.allDay) {
            print('Event: ' + event.title + '; ' + event.begin + ' (all day)');
          } else {
            print('Event: ' + event.title + '; ' + event.begin + ' ' + event.begin+ '-' + event.end);
          }

          var reminders = event.reminders;
          if (reminders && reminders.length) {
              print('There is/are ' + reminders.length + ' reminder(s)');
              for (var i = 0; i < reminders.length; i++) {
                  printReminder(reminders[i]);
              }
          }
          print('hasAlarm? ' + event.hasAlarm);
          var alerts = event.alerts;
          if (alerts && alerts.length) {
            for (var i = 0; i < alerts.length; i++) {
              printAlert(alerts[i]);
            }
          }

          var status = event.status;
          if (status == Ti.Calendar.STATUS_TENTATIVE) {
            print('This event is tentative');
          }
          if (status == Ti.Calendar.STATUS_CONFIRMED) {
            print('This event is confirmed');
          }
          if (status == Ti.Calendar.STATUS_CANCELED) {
            print('This event was canceled');
          }
        }

        var events = calendar.getEventsInYear(currentYear);
        if (events && events.length) {
          print(events.length + ' event(s) in ' + currentYear);
          print('');
          for (var i = 0; i < events.length; i++) {
            printEvent(events[i]);
            print('');
          }
        } else {
          print('No events');
        }

        label.text = consoleString;
      });
    }

    win.add(scrollView);
}


var win = Ti.UI.createWindow({
  backgroundColor: 'white',
  exitOnClose: true,
  fullscreen: false,
  layout: 'vertical',
  title: 'Calendar Demo'
});

if (Ti.Calendar.hasCalendarPermissions()) {
    performCalendarReadFunctions();
} else {
    Ti.Calendar.requestCalendarPermissions(function(e) {
        if (e.success) {
            performCalendarReadFunctions();
        } else {
            Ti.API.error(e.error);
            alert('Access to calendar is not allowed');
        }
    });
}

win.open();

Create a Recurring Event with Alerts on iOS

Create a recurring event with alerts.

function printEventDetails(eventID) {
    Ti.API.info('eventID:' + eventID);
    var defCalendar = Ti.Calendar.defaultCalendar;
    var eventFromCalendar = defCalendar.getEventById(eventID);
    if (eventFromCalendar != null) {
        Ti.API.info('Printing event values ::');
        Ti.API.info('title : '+ eventFromCalendar.title);
        Ti.API.info('notes : ' + eventFromCalendar.notes);
        Ti.API.info('location:' + eventFromCalendar.location);
        Ti.API.info('allDay ? :' + eventFromCalendar.allDay);
        Ti.API.info('status : '+ eventFromCalendar.status);
        Ti.API.info('availability : '+ eventFromCalendar.availability);
        Ti.API.info('hasAlarm ? : '+ eventFromCalendar.hasAlarm);
        Ti.API.info('id : '+ eventFromCalendar.id);
        Ti.API.info('isDetached ? : '+ eventFromCalendar.isDetached);
        Ti.API.info('begin : '+ eventFromCalendar.begin);
        Ti.API.info('end : '+ eventFromCalendar.end);
        var eventRule = eventFromCalendar.recurrenceRules;
        Ti.API.info("recurrenceRules : " + eventRule);
        for (var i = 0; i < eventRule.length; i++) {
            Ti.API.info("Rule # "+ i);
            Ti.API.info('frequency : ' + eventRule[i].frequency);
            Ti.API.info('interval : ' + eventRule[i].interval);
            Ti.API.info('daysofTheWeek : ' );
            var daysofTheWeek = eventRule[i].daysOfTheWeek; 
            for (var j = 0; j < daysofTheWeek.length; j++) {
                Ti.API.info('{ dayOfWeek : '+ daysofTheWeek[j].dayOfWeek +'weekNumber : '+daysofTheWeek[j].week +'}, ');
            }
            Ti.API.info('firstDayOfTheWeek : ' + eventRule[i].firstDayOfTheWeek);
            Ti.API.info('daysOfTheMonth : ');
            var daysOfTheMonth = eventRule[i].daysOfTheMonth;
            for(var j=0;j<daysOfTheMonth.length;j++) {
                Ti.API.info(' ' + daysOfTheMonth[j]);
            }
            Ti.API.info('daysOfTheYear : ');
            var daysOfTheYear = eventRule[i].daysOfTheYear;
            for(var j=0;i<daysOfTheYear.length;j++) {
                Ti.API.info(' ' + daysOfTheYear[j]);
            }
            Ti.API.info('weeksOfTheYear : ');
            var weeksOfTheYear = eventRule[i].weeksOfTheYear;
            for(var j=0;j<weeksOfTheYear.length;j++) {
                Ti.API.info(' ' + weeksOfTheYear[j]);
            }
            Ti.API.info('monthsOfTheYear : ');
            var monthsOfTheYear = eventRule[i].monthsOfTheYear;
            for(var j=0;j<monthsOfTheYear.length;j++) {
                Ti.API.info(' ' + monthsOfTheYear[j]);
            }
            Ti.API.info('daysOfTheYear : ');
            var setPositions = eventRule[i].setPositions;
            for(var j=0;j<setPositions.length;j++) {
                Ti.API.info(' ' + setPositions[j]);
            }
        };
        Ti.API.info('alerts : '+ eventFromCalendar.alerts);
        var newAlerts = eventFromCalendar.alerts;

        for(var i=0 ; i < newAlerts.length ; i++) {
            Ti.API.info('*****ALert '+ i);
            Ti.API.info('absoluteDate :'+ newAlerts[i].absoluteDate);
            Ti.API.info('relativeOffset ;' + newAlerts[i].relativeOffset);
        }
   }
}
function performCalendarWriteFunctions(){
    var defCalendar = Ti.Calendar.defaultCalendar;
    var date1 = new Date(new Date().getTime() + 3000),
        date2 = new Date(new Date().getTime() + 900000);
    Ti.API.info('Date1 : '+ date1 + 'Date2 : '+ date2);
    var event1 = defCalendar.createEvent({
                        title: 'Sample Event',
                        notes: 'This is a test event which has some values assigned to it.',
                        location: 'Appcelerator Inc',
                        begin: date1,
                        end: date2,
                        availability: Ti.Calendar.AVAILABILITY_FREE,
                        allDay: false,
                });
    var alert1 = event1.createAlert({
                        absoluteDate: new Date(new Date().getTime() - (1000*60*20))
                });
    var alert2 = event1.createAlert({
        relativeOffset:-(60*15)
    })
    var allAlerts = new Array(alert1,alert2);
    event1.alerts = allAlerts;
    var newRule = event1.createRecurrenceRule({
                        frequency: Ti.Calendar.RECURRENCEFREQUENCY_MONTHLY,
                        interval: 1,
                        daysOfTheWeek: [{dayOfWeek:1,week:2},{dayOfWeek:2}],
                        end: {occurrenceCount:10}
                });
    Ti.API.info('newRule : '+ newRule);
    event1.recurrenceRules = [newRule];
    Ti.API.info('Going to save event now');
    event1.save(Ti.Calendar.SPAN_THISEVENT);
    Ti.API.info('Done with saving event,\n Now trying to retreive it.');
    printEventDetails(event1.id);
}
var win = Ti.UI.createWindow({
                        backgroundColor: 'white',
                        title: 'Calendar Demo'
            });

var label = Ti.UI.createLabel({
                        text: 'Check console log',
                        height: Ti.UI.size,
                        width: Ti.UI.size
            });
win.add(label);

if (Ti.Calendar.hasCalendarPermissions()) {
    performCalendarReadFunctions();
} else {
    Ti.Calendar.requestCalendarPermissions(function(e) {
        if (e.success) {
            performCalendarReadFunctions();
        } else {
            alert('Access to calendar is not allowed');
        }
    });
}

win.open();
  • 3.2.0
  • 3.1.0
  • 3.1.0
Defined By

Properties

Titanium.Calendar
ATTENDEE_ROLE_CHAIR : Numberreadonly

Attendee role is chair.

Attendee role is chair.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_ROLE_NON_PARTICIPANT : Numberreadonly

Attendee is not a participant.

Attendee is not a participant.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_ROLE_OPTIONAL : Numberreadonly

Attendee role is optional.

Attendee role is optional.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_ROLE_REQUIRED : Numberreadonly

Attendee role is required.

Attendee role is required.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_ROLE_UNKNOWN : Numberreadonly

Attendee role is unknown.

Attendee role is unknown.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_ACCEPTED : Numberreadonly

Attendee status is accepted.

Attendee status is accepted.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_DECLINED : Numberreadonly

Attendee status is declined.

Attendee status is declined.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_DELEGATED : Numberreadonly

Attendee status is delegated.

Attendee status is delegated.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_INVITED : Numberreadonly

Attendee status is invited.

Attendee status is invited.

  • 6.2.0
Titanium.Calendar
ATTENDEE_STATUS_IN_PROCESS : Numberreadonly

Attendee status is in process.

Attendee status is in process.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_NONE : Numberreadonly

There is no Attendee status.

There is no Attendee status.

  • 6.2.0
Titanium.Calendar
ATTENDEE_STATUS_PENDING : Numberreadonly

Attendee status is pending.

Attendee status is pending.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_TENTATIVE : Numberreadonly

Attendee status is tentative.

Attendee status is tentative.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_STATUS_UNKNOWN : Numberreadonly

Attendee status is unknown.

Attendee status is unknown.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_TYPE_GROUP : Numberreadonly

Attendee type is group.

Attendee type is group.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_TYPE_NONE : Numberreadonly

There is not attendee type.

There is not attendee type.

  • 6.2.0
Titanium.Calendar
ATTENDEE_TYPE_PERSON : Numberreadonly

Attendee type is person.

Attendee type is person.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_TYPE_REQUIRED : Numberreadonly

Attendee type is required.

Attendee type is required.

  • 6.2.0
Titanium.Calendar
ATTENDEE_TYPE_RESOURCE : Numberreadonly

Attendee type is resource.

Attendee type is resource.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_TYPE_ROOM : Numberreadonly

Attendee type is room.

Attendee type is room.

  • 6.0.0
  • 6.0.0
Titanium.Calendar
ATTENDEE_TYPE_UNKNOWN : Numberreadonly

Attendee type is unknown.

Attendee type is unknown.

  • 6.2.0
  • 6.0.0
  • 6.0.0
Titanium.Calendar
AUTHORIZATION_AUTHORIZED : Numberreadonly

A eventsAuthorization value indicating that the application is authorized to use events in the Calendar.

A eventsAuthorization value indicating that the application is authorized to use events in the Calendar.

This value is always returned if the device is running an iOS release prior to 6.0.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AUTHORIZATION_DENIED : Numberreadonly

A eventsAuthorization value indicating that the application is not authorized to use events in the Calendar.

A eventsAuthorization value indicating that the application is not authorized to use events in the Calendar.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
: Numberreadonly
A eventsAuthorization value indicating that the application is not authorized to use events in the Calendar. ...

A eventsAuthorization value indicating that the application is not authorized to use events in the Calendar. the user cannot change this application's status.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AUTHORIZATION_UNKNOWN : Numberreadonly

A eventsAuthorization value indicating that the authorization state is unknown.

A eventsAuthorization value indicating that the authorization state is unknown.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AVAILABILITY_BUSY : Numberreadonly

Event has a busy availability setting.

Event has a busy availability setting.

A event availability value.

One of the group of event method constants, AVAILABILITY_NOTSUPPORTED, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, and AVAILABILITY_UNAVAILABLE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AVAILABILITY_FREE : Numberreadonly

Event has a free availability setting.

Event has a free availability setting.

A event availability value.

One of the group of event method constants, AVAILABILITY_NOTSUPPORTED, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, and AVAILABILITY_UNAVAILABLE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AVAILABILITY_NOTSUPPORTED : Numberreadonly

Availability settings are not supported by the event's calendar.

Availability settings are not supported by the event's calendar.

A event availability value.

One of the group of event method constants, AVAILABILITY_NOTSUPPORTED, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, and AVAILABILITY_UNAVAILABLE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AVAILABILITY_TENTATIVE : Numberreadonly

Event has a tentative availability setting.

Event has a tentative availability setting.

A event availability value.

One of the group of event method constants, AVAILABILITY_NOTSUPPORTED, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, and AVAILABILITY_UNAVAILABLE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
AVAILABILITY_UNAVAILABLE : Numberreadonly

Event has a tentative availability setting.

Event has a tentative availability setting.

A event availability value.

One of the group of event method constants, AVAILABILITY_NOTSUPPORTED, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, and AVAILABILITY_UNAVAILABLE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
METHOD_ALERT : Numberreadonly

Reminder alert delivery method.

Reminder alert delivery method.

Used with Titanium.Calendar.Reminder.

One of the group of reminder method constants, METHOD_ALERT, METHOD_DEFAULT, METHOD_EMAIL, and METHOD_SMS.

  • 3.2.0
Titanium.Calendar
METHOD_DEFAULT : Numberreadonly

Reminder default delivery method.

Reminder default delivery method.

Used with Titanium.Calendar.Reminder.

One of the group of reminder method constants, METHOD_ALERT, METHOD_DEFAULT, METHOD_EMAIL, and METHOD_SMS.

  • 3.2.0
Titanium.Calendar
METHOD_EMAIL : Numberreadonly

Reminder email delivery method.

Reminder email delivery method.

Used with Titanium.Calendar.Reminder.

One of the group of reminder method constants, METHOD_ALERT, METHOD_DEFAULT, METHOD_EMAIL, and METHOD_SMS.

  • 3.2.0
Titanium.Calendar
METHOD_SMS : Numberreadonly

Reminder SMS delivery method.

Reminder SMS delivery method.

Used with Titanium.Calendar.Reminder.

One of the group of reminder method constants, METHOD_ALERT, METHOD_DEFAULT, METHOD_EMAIL, and METHOD_SMS.

  • 3.2.0
Titanium.Calendar
RECURRENCEFREQUENCY_DAILY : Numberreadonly

Indicates a daily recurrence rule for a events reccurance frequency.

Indicates a daily recurrence rule for a events reccurance frequency.

Used with the Titanium.Calendar.RecurrenceRule.frequency property.

One of the group of event "frequency" constants RECURRENCEFREQUENCY_DAILY, RECURRENCEFREQUENCY_WEEKLY, RECURRENCEFREQUENCY_MONTHLY, and RECURRENCEFREQUENCY_YEARLY.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
RECURRENCEFREQUENCY_MONTHLY : Numberreadonly

Indicates a monthly recurrence rule for a events reccurance frequency.

Indicates a monthly recurrence rule for a events reccurance frequency.

Used with the Titanium.Calendar.RecurrenceRule.frequency property.

One of the group of event "frequency" constants RECURRENCEFREQUENCY_DAILY, RECURRENCEFREQUENCY_WEEKLY, RECURRENCEFREQUENCY_MONTHLY, and RECURRENCEFREQUENCY_YEARLY.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
RECURRENCEFREQUENCY_WEEKLY : Numberreadonly

Indicates a weekly recurrence rule for a events reccurance frequency.

Indicates a weekly recurrence rule for a events reccurance frequency.

Used with the Titanium.Calendar.RecurrenceRule.frequency property.

One of the group of event "frequency" constants RECURRENCEFREQUENCY_DAILY, RECURRENCEFREQUENCY_WEEKLY, RECURRENCEFREQUENCY_MONTHLY, and RECURRENCEFREQUENCY_YEARLY.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
RECURRENCEFREQUENCY_YEARLY : Numberreadonly

Indicates a yearly recurrence rule for a events reccurance frequency.

Indicates a yearly recurrence rule for a events reccurance frequency.

Used with the Titanium.Calendar.RecurrenceRule.frequency property.

One of the group of event "frequency" constants RECURRENCEFREQUENCY_DAILY, RECURRENCEFREQUENCY_WEEKLY, RECURRENCEFREQUENCY_MONTHLY, and RECURRENCEFREQUENCY_YEARLY.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
RELATIONSHIP_ATTENDEE : Numberreadonly

Relationship is attendee.

Relationship is attendee.

  • 6.2.0
Titanium.Calendar
RELATIONSHIP_NONE : Numberreadonly

There is no relationship.

There is no relationship.

  • 6.2.0
Titanium.Calendar
RELATIONSHIP_ORGANIZER : Numberreadonly

Attendee is organizer.

Attendee is organizer.

  • 6.2.0
Titanium.Calendar
RELATIONSHIP_PERFORMER : Numberreadonly

Attendee is performer.

Attendee is performer.

  • 6.2.0
Titanium.Calendar
RELATIONSHIP_SPEAKER : Numberreadonly

Attendee is speaker.

Attendee is speaker.

  • 6.2.0
Titanium.Calendar
RELATIONSHIP_UNKNOWN : Numberreadonly

Relationship is unknown.

Relationship is unknown.

  • 6.2.0
Titanium.Calendar
SOURCE_TYPE_BIRTHDAYS : Numberreadonly

A birthday calendar source.

A birthday calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
SOURCE_TYPE_CALDAV : Numberreadonly

A calDev calendar source.

A calDev calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
SOURCE_TYPE_EXCHANGE : Numberreadonly

A microsoft exchange calendar source.

A microsoft exchange calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
SOURCE_TYPE_LOCAL : Numberreadonly

A local calendar source.

A local calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
SOURCE_TYPE_MOBILEME : Numberreadonly

A mobileMe calendar source.

A mobileMe calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
SOURCE_TYPE_SUBSCRIBED : Numberreadonly

A subscribed calendar source.

A subscribed calendar source.

  • 6.1.0
  • 6.1.0
Titanium.Calendar
: Numberreadonly
A save/remove event value, indicating modifications to this event instance should also affect future instances of th...

A save/remove event value, indicating modifications to this event instance should also affect future instances of this event.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
SPAN_THISEVENT : Numberreadonly

A save/remove event value, indicating modifications to this event instance should affect only this instance.

A save/remove event value, indicating modifications to this event instance should affect only this instance.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
STATE_DISMISSED : Numberreadonly

Alert dismissed state.

Alert dismissed state.

Used with Titanium.Calendar.Alert.

One of the group of reminder method constants, STATE_DISMISSED, STATE_FIRED, and STATE_SCHEDULED.

  • 3.2.0
Titanium.Calendar
STATE_FIRED : Numberreadonly

Alert fired state.

Alert fired state.

Used with Titanium.Calendar.Alert.

One of the group of reminder method constants, STATE_DISMISSED, STATE_FIRED, and STATE_SCHEDULED.

  • 3.2.0
Titanium.Calendar
STATE_SCHEDULED : Numberreadonly

Alert scheduled status.

Alert scheduled status.

Used with Titanium.Calendar.Alert.

One of the group of reminder method constants, STATE_DISMISSED, STATE_FIRED, and STATE_SCHEDULED.

  • 3.2.0
Titanium.Calendar
STATUS_CANCELED : Numberreadonly

Event canceled status.

Event canceled status.

A [event status]Titanium.Calendar.Event.status value.

One of the group of event "status" constants, STATUS_NONE, STATUS_CANCELED, STATUS_CONFIRMED, and STATUS_TENTATIVE.

Titanium.Calendar
STATUS_CANCELLED : Numberreadonlyremoved

Event canceled status.

Event canceled status.

This property has been removed since 7.0.0

Use <Titanium.Calendar.STATUS_CANCELED> instead.

A [event status]Titanium.Calendar.Event.status value.

One of the group of event "status" constants, STATUS_NONE, STATUS_CANCELED, STATUS_CONFIRMED, and STATUS_TENTATIVE.

Titanium.Calendar
STATUS_CONFIRMED : Numberreadonly

Event confirmed status.

Event confirmed status.

A [event status]Titanium.Calendar.Event.status value.

One of the group of event "status" constants, STATUS_NONE, STATUS_CANCELED, STATUS_CONFIRMED, and STATUS_TENTATIVE.

Titanium.Calendar
STATUS_NONE : Numberreadonly

Event has no status.

Event has no status.

A [event status]Titanium.Calendar.Event.status value.

One of the group of event "status" constants, STATUS_CANCELED, STATUS_CONFIRMED, and STATUS_TENTATIVE.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
STATUS_TENTATIVE : Numberreadonly

Event tentative status.

Event tentative status.

A [event status]Titanium.Calendar.Event.status value.

One of the group of event "status" constants, STATUS_NONE, STATUS_CANCELED, STATUS_CONFIRMED, and STATUS_TENTATIVE.

Titanium.Calendar
VISIBILITY_CONFIDENTIAL : Numberreadonly

Event confidential visibility.

Event confidential visibility.

Used with Titanium.Calendar.Event.

One of the group of reminder method constants, VISIBILITY_CONFIDENTIAL, VISIBILITY_DEFAULT, VISIBILITY_PRIVATE, and VISIBILITY_PUBLIC.

  • 3.2.0
Titanium.Calendar
VISIBILITY_DEFAULT : Numberreadonly

Event default visibility.

Event default visibility.

Used with Titanium.Calendar.Event.

One of the group of reminder method constants, VISIBILITY_CONFIDENTIAL, VISIBILITY_DEFAULT, VISIBILITY_PRIVATE, and VISIBILITY_PUBLIC.

  • 3.2.0
Titanium.Calendar
VISIBILITY_PRIVATE : Numberreadonly

Event private visibility.

Event private visibility.

Used with Titanium.Calendar.Event.

One of the group of reminder method constants, VISIBILITY_CONFIDENTIAL, VISIBILITY_DEFAULT, VISIBILITY_PRIVATE, and VISIBILITY_PUBLIC.

  • 3.2.0
Titanium.Calendar
VISIBILITY_PUBLIC : Numberreadonly

Event public visibility.

Event public visibility.

Used with Titanium.Calendar.Event.

One of the group of reminder method constants, VISIBILITY_CONFIDENTIAL, VISIBILITY_DEFAULT, VISIBILITY_PRIVATE, and VISIBILITY_PUBLIC.

  • 3.2.0
Titanium.Calendar
allAlerts : Titanium.Calendar.Alert[]readonly

All alerts in selected calendars.

All alerts in selected calendars.

  • 3.2.0
Titanium.Calendar
allCalendars : Titanium.Calendar.Calendar[]readonly

All calendars known to the native calendar app.

All calendars known to the native calendar app.

All calendars known to the native calendar app that can add, edit, and delete items in the calendar.

All calendars known to the native calendar app that can add, edit, and delete items in the calendar.

  • 3.1.0
  • 3.1.0
apiName : Stringreadonly

The name of the API that this proxy corresponds to.

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, Button returns Ti.UI.Button.

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

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

  • 3.0.0
  • 3.0.0
  • 3.0.0
Titanium.Calendar
calendarAuthorization : Numberreadonly

Returns an authorization constant indicating if the application has access to the events in the EventKit.

Returns an authorization constant indicating if the application has access to the events in the EventKit.

Always returns AUTHORIZATION_AUTHORIZED on iOS pre-6.0. type: Number

This API can be assigned the following constants:

  • 5.2.0
  • 5.2.0
Titanium.Calendar
defaultCalendar : Titanium.Calendar.Calendarreadonly

Calendar that events are added to by default, as specified by user settings.

Calendar that events are added to by default, as specified by user settings.

  • 3.1.0
  • 3.1.0
Titanium.Calendar
: Numberdeprecatedreadonly
Returns an authorization constant indicating if the application has access to the events in the EventKit. ...

Returns an authorization constant indicating if the application has access to the events in the EventKit.

deprecated since 5.2.0

Use <Titanium.Calendar.calendarAuthorization> instead.

Always returns AUTHORIZATION_AUTHORIZED on iOS pre-6.0.

This API can be assigned the following constants:

  • 3.1.0
  • 3.1.0

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

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.

  • 3.6.0
Titanium.Calendar
selectableCalendars : Titanium.Calendar.Calendar[]readonly

All calendars selected within the native calendar app, which may be a subset of allCalendars.

All calendars selected within the native calendar app, which may be a subset of allCalendars.

The native calendar application may know via the registered webservices, such as Gooogle or Facebook accounts about calendars that it has access to but have not been selected to be displayed in the native calendar app.

  • 3.2.0
Defined By

Methods

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

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

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
Applies the properties to the proxy. ...

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.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • 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

  • void
Titanium.Calendar
( ) : Titanium.Calendar.Alert[]
Gets the value of the allAlerts property. ...

Gets the value of the allAlerts property.

  • 3.2.0

Returns

Gets the value of the allCalendars property. ...

Gets the value of the allCalendars property.

Returns

Gets the value of the allEditableCalendars property. ...

Gets the value of the allEditableCalendars property.

  • 3.1.0
  • 3.1.0

Returns

Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Titanium.Calendar
( ) : Number
Gets the value of the calendarAuthorization property. ...

Gets the value of the calendarAuthorization property.

  • 5.2.0
  • 5.2.0

Returns

  • Number
Gets the calendar with the specified identifier. ...

Gets the calendar with the specified identifier.

Parameters

  • id : String

    Identifier of the calendar.

Returns

Gets the value of the defaultCalendar property. ...

Gets the value of the defaultCalendar property.

  • 3.1.0
  • 3.1.0

Returns

Titanium.Calendar
( ) : Numberdeprecated
Gets the value of the eventsAuthorization property. ...

Gets the value of the eventsAuthorization property.

deprecated since 5.2.0

Use <Titanium.Calendar.calendarAuthorization> instead.

  • 3.1.0
  • 3.1.0

Returns

  • Number
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Gets the value of the selectableCalendars property. ...

Gets the value of the selectableCalendars property.

  • 3.2.0

Returns

Titanium.Calendar
( ) : Boolean
Returns true if the app has calendar access. ...

Returns true if the app has calendar access.

  • 5.1.0
  • 5.1.0
  • 5.1.0

Returns

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

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 : String

    Name of the event.

  • callback : Callback<Object>

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

Returns

  • void
Titanium.Calendar
( callback )
Requests for calendar access. ...

Requests for calendar access.

On Android, the request view will show if the permission is not accepted by the user, and the user did not check the box "Never ask again" when denying the request. If the user checks the box "Never ask again," the user has to manually enable the permission in device settings. This method requests Manifest.permission.READ_CALENDAR and Manifest.permission.WRITE_CALENDAR on Android. If yourequire other permissions, you can also use Titanium.Android.requestPermissions.

In iOS 6, Apple introduced the Info.plist key NSCalendarsUsageDescription that is used to display an own description while authorizing calendar permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 5.1.0
  • 5.1.0
  • 5.1.0

Parameters

Returns

  • void
Titanium.Calendar
( callback )deprecated
If authorization is unknown, will bring up a dialog requesting permission. ...

If authorization is unknown, will bring up a dialog requesting permission.

deprecated since 5.1.0

Use <Titanium.Calendar.requestCalendarPermissions> instead.

Note that the callback may be synchronous or asynchronous. That is, it may be called during requestEventsAuthorization or much later. See the "Request access to the events" example on how to best use this method.

  • 3.1.0
  • 3.1.0

Parameters

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Defined By

Events

Titanium.Calendar
Fired when the database backing the EventKit module is modified. ...

Fired when the database backing the EventKit module is modified.

This eventis fired when changes are made to the Calendar database, including adding, removing, and changing events or reminders. Individual changes are not described. When you receive this notification, you should refetch all Event objects you have accessed, as they are considered stale. If you are actively editing an event and do not wish to refetch it unless it is absolutely necessary to do so, you can call the refresh method on it. If the method returns YES, you do not need to refetch the event.

  • 3.1.0
  • 3.1.0

Properties

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

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

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •