CalendarEvent
The CalendarEvent
object represents an event in the device calendar. It can be obtained by calling blackberry.pim.calendar.createEvent() or blackberry.pim.calendar.findEvents()
Supported Platform(s)
- BlackBerry 10 |
API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
createExceptionEvent | Y | ||||||
remove | Y | ||||||
save | Y | ||||||
allDay | Y | ||||||
attendees | Y | ||||||
birthday | Y | ||||||
description | Y | ||||||
end | Y | ||||||
folder | Y | ||||||
id | Y | ||||||
location | Y | ||||||
originalStartTime | Y | ||||||
parentId | Y | ||||||
recurrence | Y | ||||||
reminder | Y | ||||||
sensitivity | Y | ||||||
start | Y | ||||||
status | Y | ||||||
summary | Y | ||||||
timezone | Y | ||||||
transparency | Y | ||||||
url | Y | ||||||
SENSITIVITY_NORMAL | Y | ||||||
SENSITIVITY_PERSONAL | Y | ||||||
SENSITIVITY_PRIVATE | Y | ||||||
SENSITIVITY_CONFIDENTIAL | Y | ||||||
TRANSPARENCY_FREE | Y | ||||||
TRANSPARENCY_TENTATIVE | Y | ||||||
TRANSPARENCY_BUSY | Y | ||||||
TRANSPARENCY_OUT_OF_OFFICE | Y |
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
Properties
Boolean | allDay |
blackberry.pim.calendar.Attendee[] | attendees |
Boolean | birthday |
String | description |
Date | end |
blackberry.pim.calendar.CalendarFolder | folder |
String | id |
String | location |
Date | originalStartTime |
String | parentId |
blackberry.pim.calendar.CalendarRepeatRule | recurrence |
Number | reminder |
Number | sensitivity |
Date | start |
Number | status |
String | summary |
String | timezone |
Number | transparency |
String | url |
Constants
Number | SENSITIVITY_NORMAL |
Number | SENSITIVITY_PERSONAL |
Number | SENSITIVITY_PRIVATE |
Number | SENSITIVITY_CONFIDENTIAL |
Number | TRANSPARENCY_FREE |
Number | TRANSPARENCY_TENTATIVE |
Number | TRANSPARENCY_BUSY |
Number | TRANSPARENCY_OUT_OF_OFFICE |
Functions
blackberry.pim.calendar.CalendarEvent
createExceptionEvent
(originalStartTime : Date)
Creates a new CalendarEvent object for a recurrence exception of the calling event. This is a deep copy of the object, with the id property set to null, the parentId property set to the id of the calling event, and the originalStartTime property set to the parameter value.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
originalStartTime | The date of the original recurrence instance that this event replaces. This date will be added to the calling event's exceptionDates array within the recurrence field. |
Code Example:
|
void
remove
(onRemoveSuccess : function, onRemoveError : function, [removeAll : Boolean])
Removes the event from the calendar. An error callback is called with a blackberry.pim.calendar.CalendarError object if the removal is unsuccessful.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
onRemoveSuccess | The callback function that will be invoked when the event is removed successfully. |
onRemoveError |
The callback function that will be invoked when the event cannot be removed.
error: The blackberry.pim.calendar.CalendarError object which contains the error code. A possible error is to remove an event before it was saved, this would result in INVALID_ARGUMENT_ERROR. |
removeAll | Optional flag that only applies to recurring events. If removeAll is set to true, all occurrences of the recurring event will be removed; otherwise, only the single occurrence represented by this event object will be removed. This parameter defaults to true if not specified. |
Code Example:
|
void
save
(onSaveSuccess : function, onSaveError : function)
Saves a new event to the calendar, or updates an existing event if an event with the same id already exists.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
onSaveSuccess |
The callback function that will be invoked when the contact is saved successfully.
event: The blackberry.pim.calendar.CalendarEvent object. You should save this object for further operations on the event and use it to replace the original event object prior to save. |
onSaveError |
The callback function that will be invoked when the event cannot be saved.
error: The blackberry.pim.calendar.CalendarError object which contains the error code. Possible errors:
|
Code Example:
|
Properties
blackberry.pim.calendar.Attendee[]
attendees
The list of attendees in the event.
Supported Platforms | |
---|---|
- BlackBerry 10 |
readonly
blackberry.pim.calendar.CalendarFolder
folder
The CalendarFolder that contains this event.
Supported Platforms | |
---|---|
- BlackBerry 10 |
String
location
A plain text description of the location of the event.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Date
originalStartTime
This attribute is only meaningful in events that are recurrence exceptions.
A recurrence exception is a differing instance of a recurring event. The
originalStartTime property stores the time and date of the recurrence instance that
is replaced by this event. For example: a daily meeting at 2:00 PM that is rescheduled to
3:00 PM on a given day would have an originalStartTime of 2:00 PM.
Supported Platforms | |
---|---|
- BlackBerry 10 |
readonly
String
parentId
This attribute is only meaningful in events that are recurrence exceptions.
A recurrence exception is a differing instance of a recurring event. An example:
a daily meeting at 2:00 PM that is rescheduled to 3:00 PM on a given day. This
rescheduled occurrence is represented as an exception. It is stored in the
database as a separate event and it references the original recurring event by
means of the parent id.
Supported Platforms | |
---|---|
- BlackBerry 10 |
blackberry.pim.calendar.CalendarRepeatRule
recurrence
The recurrence or repetition rule for this event. This is used for creating a recurring event.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Number
reminder
A reminder for the event, specified as the number of minutes between the alert and the start time.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Number
sensitivity
Sensitivity level of the event: SENSITIVITY_NORMAL, SENSITIVITY_PERSONAL, SENSITIVITY_PRIVATE or SENSITIVITY_CONFIDENTIAL
Supported Platforms | |
---|---|
- BlackBerry 10 |
String
timezone
Name of the timezone where the event was created. To get the current device timezone, see blackberry.system.getCurrentTimezone(). To get the list of all possible timezones, see blackberry.system.getTimezones()
Supported Platforms | |
---|---|
- BlackBerry 10 |
Number
transparency
An indication of the display status to set for the event. Its value can be one of: TRANSPARENCY_FREE, TRANSPARENCY_TENTATIVE, TRANSPARENCY_BUSY, or TRANSPARENCY_OUT_OF_OFFICE
Supported Platforms | |
---|---|
- BlackBerry 10 |
Constants
static
Number
SENSITIVITY_NORMAL
Sensitivity level for unrestricted events.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
Number
SENSITIVITY_PERSONAL
Sensitivity level for personal events.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
Number
SENSITIVITY_PRIVATE
Sensitivity level for private events.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
Number
SENSITIVITY_CONFIDENTIAL
Sensitivity level for confidential events.
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
Number
TRANSPARENCY_FREE
Transparency constant. Used to inform that the event represents free time (the event's owner is available).
Supported Platforms | |
---|---|
- BlackBerry 10 |
static
Number
TRANSPARENCY_TENTATIVE
Transparency constant. Used to inform that an event may or may not happen (the owner may be available).
Supported Platforms | |
---|---|
- BlackBerry 10 |