Class 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 {@tutorial layers} guide for more details.

Alias

ICAL.Event

Hierarchy

  • Event

Constructors

  • Creates a new ICAL.Event instance.

    Parameters

    • Optional component: Component

      The ICAL.Component to base this event on

    • Optional options: {
          exceptions: (Component | Event)[];
          strictExceptions: boolean;
      }

      Options for this event

      • exceptions: (Component | Event)[]

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

      • strictExceptions: boolean

        When true, will verify exceptions are related by their UUID

    Returns Event

Properties

_rangeExceptionCache: Record<string, Duration>
component: Component
exceptions: Record<string, Event>

List of related event exceptions.

rangeExceptions: [number, string][]
strictExceptions: boolean = false

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

THISANDFUTURE: string = 'THISANDFUTURE'

Accessors

  • get color(): string
  • The event color from rfc7986

    Returns string

  • set color(value): void
  • Parameters

    • value: string

    Returns void

  • get description(): string
  • The event description.

    Returns string

  • set description(value): void
  • Parameters

    • value: string

    Returns void

  • get duration(): 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.

    Returns Duration

  • set duration(value): void
  • Parameters

    Returns void

  • get endDate(): 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.

    Returns Time

  • set endDate(value): void
  • Parameters

    Returns void

  • get location(): string
  • The location of the event.

    Returns string

  • set location(value): void
  • Parameters

    • value: string

    Returns void

  • get 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:...

    Returns string

  • set organizer(value): void
  • Parameters

    • value: string

    Returns void

  • get recurrenceId(): Time
  • The recurrence id for this event. See {@tutorial terminology} for details.

    Returns Time

  • set recurrenceId(value): void
  • Parameters

    Returns void

  • get sequence(): number
  • The sequence value for this event. Used for scheduling see {@tutorial terminology}.

    Returns number

  • set sequence(value): void
  • Parameters

    • value: number

    Returns void

  • get summary(): string
  • The event summary

    Returns string

  • set summary(value): void
  • Parameters

    • value: string

    Returns void

  • get uid(): null | string
  • The uid of this event

    Returns null | string

  • set uid(value): void
  • Parameters

    • value: null | string

    Returns void

Methods

  • Parameters

    • name: string

    Returns any

  • Parameters

    • name: string
    • value: string | number | object

    Returns void

  • Private

    Set/update a time property's value. This will also update the TZID of the property.

    TODO: this method handles the case where we are switching from a known timezone to an implied timezone (one without TZID). This does not handle the case of moving between a known (by TimezoneService) timezone to an unknown timezone...

    We will not add/remove/update the VTIMEZONE subcomponents leading to invalid ICAL data...

    Parameters

    • propName: string

      The property name

    • time: Time

      The time to set

    Returns void

  • Finds the range exception nearest to the given date.

    Parameters

    • time: Time

      usually an occurrence time of an event

    Returns null | string

    the related event/exception or null

  • 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

    • occurrence: Time

      time occurrence

    Returns OccurrenceDetails

    Information about the occurrence

  • 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 Record<"SECONDLY" | "MINUTELY" | "HOURLY" | "DAILY" | "WEEKLY" | "MONTHLY" | "YEARLY", boolean>

    Object of recurrence flags

  • Checks if the event describes a recurrence exception. See {@tutorial terminology} for details.

    Returns boolean

    True, if the event describes a recurrence exception

  • Checks if the event is recurring

    Returns boolean

    True, if event is recurring

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

    Parameters

    • startTime: Time

      Starting point for expansion

    Returns RecurExpansion

    Expansion object

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

    Returns boolean

    True, when exception is within range

  • 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

    Returns void

  • The string representation of this event.

    Returns string

Generated using TypeDoc