Class Period

This class represents the "period" value type, with various calculation and manipulation methods.

Hierarchy

  • Period

Constructors

  • Creates a new ICAL.Period instance. The passed data object cannot contain both and end date and a duration.

    Parameters

    • aData: PeriodData

      An object with members of the period

    Returns Period

Properties

duration?: null | Duration

The duration of the period

end?: Time

The end of the period

icalclass: "icalperiod" = 'icalperiod'

The class identifier.

icaltype: "period" = 'period'

The type name, to be used in the jCal object.

start?: Time

The start of the period

wrappedJSObject: Period

Methods

  • Calculates the duration of the period, either directly or by subtracting start from end date.

    Returns Duration

    The calculated duration

  • Calculates the end date of the period, either directly or by adding duration to start date.

    Returns Time

    The calculated end date

  • The iCalendar string representation of this period.

    Returns string

  • The jCal representation of this period type.

    Returns [string, string]

  • The string representation of this period.

    Returns string

  • Creates a new Period instance from the given data object. The passed data object cannot contain both and end date and a duration.

    Parameters

    • aData: PeriodData

      An object with members of the period

    Returns Period

    The period instance

  • Returns a new period instance from the given jCal data array. The first member is always the start date string, the second member is either a duration or end date string.

    Parameters

    • aData: string | [string, string]

      The jCal data array

    • aProp: undefined | Property

      The property this jCal data is on

    • aLenient: boolean

      If true, data value can be both date and date-time

    Returns Period

    The period instance

  • Creates a new ICAL.Period instance from the passed string.

    Parameters

    • str: string

      The string to parse

    • prop: Property

      The property this period will be on

    Returns Period

    The created period instance

Generated using TypeDoc