ICAL. Event

ICAL.js is organized into multiple layers. The bottom layer is a raw jCal object, followed by the component/property layer. The highest level is the event representation, which this class is part of. See the layers guide for more details.

Constructor

new Event(componentopt, optionsopt)

Creates a new ICAL.Event instance.

Parameters:
NameTypeAttributesDescription
componentICAL.Component<optional>

The ICAL.Component to base this event on

optionsObject<optional>

Options for this event

Properties
NameTypeAttributesDescription
strictExceptionsBoolean<optional>

When true, will verify exceptions are related by their UUID

exceptionsArray.<(Component|Event)><optional>

Exceptions to this event, either as components or events. If not specified exceptions will automatically be set in relation of component's parent

Members

attendees :Array.<Property>

The attendees in the event

Type:
  • Array.<Property>

color :String

The event color from rfc7986

Type:
  • String

description :String

The event description.

Type:
  • String

duration :ICAL.Duration

The duration. This can be the result directly from the property, or the duration calculated from start date and end date. Setting the property will remove any dtend properties.

endDate :ICAL.Time

The end date. This can be the result directly from the property, or the end date calculated from start date and duration. Setting the property will remove any duration properties.

exceptions :Array.<Event>

List of related event exceptions.

Type:
  • Array.<Event>

location :String

The location of the event.

Type:
  • String

organizer :String

The organizer value as an uri. In most cases this is a mailto: uri, but it can also be something else, like urn:uuid:...

Type:
  • String

recurrenceId :ICAL.Time

The recurrence id for this event. See terminology for details.

sequence :Number

The sequence value for this event. Used for scheduling see terminology.

Type:
  • Number

startDate :ICAL.Time

The start date

strictExceptions :Boolean

When true, will verify exceptions are related by their UUID.

Type:
  • Boolean

summary :String

The event summary

Type:
  • String

uid :String

The uid of this event

Type:
  • String

Methods

findRangeException(time) → (nullable) {ICAL.Event}

Finds the range exception nearest to the given date.

Parameters:
NameTypeDescription
timeICAL.Time

usually an occurrence time of an event

Returns:

the related event/exception or null

Type: 
ICAL.Event

getOccurrenceDetails(occurrence) → {ICAL.Event.occurrenceDetails}

Returns the occurrence details based on its start time. If the occurrence has an exception will return the details for that exception.

NOTE: this method is intend to be used in conjunction with the iterator method.

Parameters:
NameTypeDescription
occurrenceICAL.Time

time occurrence

Returns:

Information about the occurrence

Type: 
ICAL.Event.occurrenceDetails

getRecurrenceTypes() → {Object.<ICAL.Recur.frequencyValues, Boolean>}

Returns the types of recurrences this event may have.

Returned as an object with the following possible keys:

  • YEARLY
  • MONTHLY
  • WEEKLY
  • DAILY
  • MINUTELY
  • SECONDLY
Returns:

Object of recurrence flags

Type: 
Object.<ICAL.Recur.frequencyValues, Boolean>

isRecurrenceException() → {Boolean}

Checks if the event describes a recurrence exception. See terminology for details.

Returns:

True, if the event describes a recurrence exception

Type: 
Boolean

isRecurring() → {Boolean}

Checks if the event is recurring

Returns:

True, if event is recurring

Type: 
Boolean

iterator(startTimeopt) → {ICAL.RecurExpansion}

Builds a recur expansion instance for a specific point in time (defaults to startDate).

Parameters:
NameTypeAttributesDescription
startTimeICAL.Time<optional>

Starting point for expansion

Returns:

Expansion object

Type: 
ICAL.RecurExpansion

modifiesFuture() → {Boolean}

Checks if this record is an exception and has the RANGE=THISANDFUTURE value.

Returns:

True, when exception is within range

Type: 
Boolean

relateException(obj)

Relates a given event exception to this object. If the given component does not share the UID of this event it cannot be related and will throw an exception.

If this component is an exception it cannot have other exceptions related to it.

Parameters:
NameTypeDescription
objICAL.Component | ICAL.Event

Component or event

toString() → {String}

The string representation of this event.

Returns:
Type: 
String

Type Definitions

occurrenceDetails

This object is returned by getOccurrenceDetails

Type:
  • Object
Properties
NameTypeDescription
recurrenceIdICAL.Time

The passed in recurrence id

itemICAL.Event

The occurrence

startDateICAL.Time

The start of the occurrence

endDateICAL.Time

The end of the occurrence