Calendar
The Calendar
object provides functions for creating and finding contacts.
Supported Platform(s)
- BlackBerry 10 |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
You must declare the feature element(s) below in your configuration document: |
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
<feature id="blackberry.pim.calendar" /> | Y |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
You must declare the permission element(s) below in your configuration document: |
- <rim:permit>access_pimdomain_calendars</rim:permit>
Permits your app to access calendar. |
Functions
Functions
static
blackberry.pim.calendar.CalendarEvent
blackberry.pim.calendar.createEvent
(properties : Object, [folder : blackberry.pim.calendar.CalendarFolder])
Returns a new blackberry.pim.calendar.CalendarEvent object. This method does not persist the CalendarEvent object to the device. To persist the CalendarEvent object to the device, invoke save().
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
properties | Optional object literal that specifies the field values for the CalendarEvent object. The object should be in the following form (with any number of properties): |
folder | Optional CalendarFolder object that contains the event. If no folder is specified, the event will be created in the default calendar. |
Code Example:
|
static
void
blackberry.pim.calendar.findEvents
(findOptions : blackberry.pim.calendar.CalendarFindOptions, onFindSuccess : function, [onFindError : function])
Find calendar event(s) in the calendar based on some criteria. This function can be used to look up events based on start/end time, location, or summary.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
findOptions | Options to be applied to the search. |
onFindSuccess |
Success callback function that is invoked with the events returned from the calendar.
events: The array of CalendarEvent objects from the search. |
onFindError |
Optional error callback function. Invoked when error occurs.
error: The CalendarError object which contains the error code. |
Code Example:
|
static
blackberry.pim.calendar.CalendarAccount[]
blackberry.pim.calendar.getCalendarAccounts
()
Retrieves all calendar accounts.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
blackberry.pim.calendar.CalendarAccount
blackberry.pim.calendar.getDefaultCalendarAccount
()
Retrieves the default calendar account.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
blackberry.pim.calendar.CalendarFolder
blackberry.pim.calendar.getDefaultCalendarFolder
()
Retrieves the default calendar folder.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
blackberry.pim.calendar.CalendarEvent
blackberry.pim.calendar.getEvent
(eventId : String, folder : blackberry.pim.calendar.Folder)
Retrieves the event with specified eventId and folder. This function is especially useful if you have previously obtained an event object, and you want to get a fresh copy from the backend to make sure all its properties are up-to-date.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
eventId | The identifier of the event |
folder | the folder that contains this event |