Calendar

This API allows you to add events to the Calendar of the mobile device.

Usage
var startDate = new Date(2015,2,15,18,30,0,0,0); // beware: month 0 = january, 11 = december
var endDate = new Date(2015,2,15,19,30,0,0,0);
var title = "My New Event";
var eventLocation = "Home";
var notes = "Some notes about this event.";
// create an event silently
Calendar.createEvent(
    title,
    eventLocation,
    notes,
    startDate,
    endDate
);
var startDate = new Date(2015, 2, 15, 18, 30, 0, 0, 0); // beware: month 0 = january, 11 = december
var endDate = new Date(2015, 2, 15, 19, 30, 0, 0, 0);
var title = "My New Event";
var eventLocation = "Home";
var notes = "Some notes about this event.";
// create an event silently
window.Calendar.createEvent(
    title,
    eventLocation,
    notes,
    startDate,
    endDate
);
var startDate = new Date(2015, 2, 15, 18, 30, 0, 0, 0); // beware: month 0 = january, 11 = december
var endDate = new Date(2015, 2, 15, 19, 30, 0, 0, 0);
var title = "My New Event";
var eventLocation = "Home";
var notes = "Some notes about this event.";
// create an event silently
window.Calendar.createEvent(
    title,
    eventLocation,
    notes,
    startDate,
    endDate
);
var startDate = new Date(2015, 2, 15, 18, 30, 0, 0); // beware: month 0 = january, 11 = december
var endDate = new Date(2015, 2, 15, 19, 30, 0, 0);
var title = "My New Event";
var eventLocation = "Home";
var notes = "Some notes about this event.";
// create an event silently
(<any>window).Calendar.createEvent(
    title,
    eventLocation,
    notes,
    startDate,
    endDate
);
var startDate = new Date(2015, 2, 15, 18, 30, 0, 0, 0); // beware: month 0 = january, 11 = december
var endDate = new Date(2015, 2, 15, 19, 30, 0, 0, 0);
var title = "My New Event";
var eventLocation = "Home";
var notes = "Some notes about event.";
// create an event silently
window.Calendar.createEvent(
    title,
    eventLocation,
    notes,
    startDate,
    endDate
);

Classes


Calendar

createCalendar
createCalendar(nameOrOptions: string | NameOrOptions): Promise<any>

Create a calendar.


PARAMETERS
options: string | NameOrOptionseither a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

createEvent
createEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>

Silently create an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

createEventWithOptions
createEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>

Silently create an event with additional options.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] options: CalendarOptions

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

createEventInteractively
createEventInteractively(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>

Interactively create an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

createEventInteractivelyWithOptions
createEventInteractivelyWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>

Silently create an event with additional options.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] options: CalendarOptions

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

deleteCalendar
deleteCalendar(calendarName: string): Promise<any>

Delete a calendar.


PARAMETERS
calendarName: string

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

deleteEvent
deleteEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>

Delete an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

deleteEventById
deleteEventById(id: string, fromDate?: Date): Promise<any>

Delete an event by id.


PARAMETERS
id: string
[optional] fromDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

deleteEventFromNamedCalendar
deleteEventFromNamedCalendar(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, calendarName?: string): Promise<any>

Delete an event from the specified Calendar.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] calendarName: string

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

findAllEventsInNamedCalendar
findAllEventsInNamedCalendar(calendarName: string): Promise<any>

Get a list of all future events in the specified calendar.


PARAMETERS
calendarName: string

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

findEvent
findEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>

Find an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

findEventWithOptions
findEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>

Find an event with additional options.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] options: CalendarOptions

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

getCalendarOptions
getCalendarOptions(calendarName: string): CalendarOptions

Returns the default calendar options.


RETURN
returns: CalendarOptions
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

getCreateCalendarOptions
getCreateCalendarOptions(calendarName: string): NameOrOptions

Returns the default calendar options.


RETURN
returns: NameOrOptions
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

hasReadPermission
hasReadPermission(): Promise<boolean>

Check if we have read permission.


RETURN
returns: Promise<boolean>
hasReadWritePermission
hasReadWritePermission(): Promise<boolean>

This function checks if we have permission to read/write from/to the calendar. If this returns false, you should call the requestReadWritePermission function.


RETURN
returns: Promise<boolean>
hasWritePermission
hasWritePermission(): Promise<boolean>

Check if we have write permission.


RETURN
returns: Promise<boolean>
listCalendars
listCalendars(): Promise<any>

Get a list of all calendars.


RETURN
returns: Promise<any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

listEventsInRange
listEventsInRange(): Promise<any>

Find a list of events within the specified date range.


PARAMETERS
startDate: Date endDate: Date
RETURN
returns: Promise<any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

modifyEvent
modifyEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, newTitle?: string, newLocation?: string, newNotes?: string, newStartDate?: Date, newEndDate?: Date): Promise<any>

Modify an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] newTitle: string
[optional] newLocation: string
[optional] newNotes: string
[optional] newStartDate: Date
[optional] newEndDate: Date

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

modifyEventWithOptions
modifyEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, newTitle?: string, newLocation?: string, newNotes?: string, newStartDate?: Date, newEndDate?: Date, filterOptions?: calendarOptions, newOptions?: calendarOptions): Promise<any>

Modify an event.


PARAMETERS
[optional] title: string
[optional] location: string
[optional] notes: string
[optional] startDate: Date
[optional] endDate: Date
[optional] newTitle: string
[optional] newLocation: string
[optional] newNotes: string
[optional] newStartDate: Date
[optional] newEndDate: Date
[optional] filterOptions: CalendarOptions
[optional] newOptions: CalendarOptions

RETURN
returns: Promise <any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

openCalendar
openCalendar(date: Date): Promise<any>

Open the calendar at the specified date.


PARAMETERS
date: Date
RETURN
returns: Promise<any>
PERMISSIONS

This method requires CALENDAR Permission set on Fawi Office - publish settings.

requestReadPermission
requestReadPermission(): Promise<any>

Request read permission.


RETURN
returns: Promise<any>
requestReadWritePermission
requestReadWritePermission(): Promise<any>

Requests read/write permissions.


RETURN
returns: Promise<any>
requestWritePermission
requestWritePermission(): Promise<any>

Request write permission.


RETURN
returns: Promise<any>

Interfaces

NameOrOptions
interface NameOrOptions {
    // The name of the calendar
    name : string;
    // The color of the calendar
    color : string (hexadecimal)
}
CalendarOptions
interface CalendarOptions {
    // Calendar id
    calendarId? : number;
    // First reminder in minutes
    firstReminderMinutes? : number;
    // Id
    id? : string;
    // Recurrence. Can be set to "daily", "weekly", "monthly" or "yearly"
    recurrence? : string;
    // Recurrence end date. Valid only when recurrence option is set
    recurrenceEndDate? : Date;
    // Recurrence interval. Valid only when recurrence option is set
    recurrenceInterval? : number;
    // Second reminder in minutes
    secondReminderMinutes? : number;
    // URL
    url? : string;
}