Variable TimezoneServiceConst

TimezoneService: {
    get count(): number;
    get(tzid) => undefined | Timezone;
    has(tzid) => boolean;
    register(name, timezone?) => void;
    registerTimezones(__namedParameters) => void;
    remove(tzid) => void;
    reset() => void;
} = ...

Singleton class to contain timezones. Right now it is all manual registry in the future we may use this class to download timezone information or handle loading pre-expanded timezones.

Type declaration

  • get count(): number
  • get:function
    • Returns a timezone by its tzid if present.

      Parameters

      • tzid: string

        Timezone identifier (e.g. America/Los_Angeles)

      Returns undefined | Timezone

      The timezone, or null if not found

  • has:function
    • Checks if timezone id has been registered.

      Parameters

      • tzid: string

        Timezone identifier (e.g. America/Los_Angeles)

      Returns boolean

      False, when not present

  • register:function
    • Registers a timezone object or component.

      Parameters

      • name: string | Component

        The name of the timezone. Defaults to the component's TZID if not passed.

      • Optional timezone: Component | Timezone

        The initialized zone or vtimezone.

      Returns void

  • registerTimezones:function
    • Register timezone definitions.

      Parameters

      • __namedParameters: {
            tzdata: string[];
        }
        • tzdata: string[]

      Returns void

      Example

      import { TimezoneService } from 'ical';
      import tzdata from 'ical/timezones.json';
      TimezoneService.registerTimezones(tzdata);
  • remove:function
    • Removes a timezone by its tzid from the list.

      Parameters

      • tzid: string

        Timezone identifier (e.g. America/Los_Angeles)

      Returns void

  • reset:function

Exports

module:ICAL.TimezoneService

Alias

ICAL.TimezoneService

Generated using TypeDoc