ICAL. Timezone

Timezone representation.

Constructor

new Timezone(data)

Creates a new ICAL.Timezone instance, by passing in a tzid and component.

Parameters:
NameTypeDescription
dataICAL.Component | Object

options for class

Properties
NameTypeDescription
componentString | ICAL.Component

If data is a simple object, then this member can be set to either a string containing the component data, or an already parsed ICAL.Component

tzidString

The timezone identifier

locationString

The timezone locationw

tznamesString

An alternative string representation of the timezone

latitudeNumber

The latitude of the timezone

longitudeNumber

The longitude of the timezone

Example
var vcalendar;
var timezoneComp = vcalendar.getFirstSubcomponent('vtimezone');
var tzid = timezoneComp.getFirstPropertyValue('tzid');

var timezone = new ICAL.Timezone({
  component: timezoneComp,
  tzid
});

Members

component :ICAL.Component

The vtimezone component for this timezone.

(constant) icalclass :String

The class identifier.

Type:
  • String
Default Value
  • "icaltimezone"

latitude :Number

The primary latitude for the timezone.

Type:
  • Number

location :String

Timezone location

Type:
  • String

longitude :Number

The primary longitude for the timezone.

Type:
  • Number

tzid :String

Timezone identifier

Type:
  • String

tznames :String

Alternative timezone name, for the string representation

Type:
  • String

Methods

fromData(aData)

Sets up the current instance using members from the passed data object.

Parameters:
NameTypeDescription
aDataICAL.Component | Object

options for class

Properties
NameTypeDescription
componentString | ICAL.Component

If aData is a simple object, then this member can be set to either a string containing the component data, or an already parsed ICAL.Component

tzidString

The timezone identifier

locationString

The timezone locationw

tznamesString

An alternative string representation of the timezone

latitudeNumber

The latitude of the timezone

longitudeNumber

The longitude of the timezone

toString() → {String}

The string representation of this timezone.

Returns:
Type: 
String

utcOffset(tt) → {Number}

Finds the utcOffset the given time would occur in this timezone.

Parameters:
NameTypeDescription
ttICAL.Time

The time to check for

Returns:

utc offset in seconds

Type: 
Number

(static) convert_time(tt, from_zone, to_zone) → {ICAL.Time}

Convert the date/time from one zone to the next.

Parameters:
NameTypeDescription
ttICAL.Time

The time to convert

from_zoneICAL.Timezone

The source zone to convert from

to_zoneICAL.Timezone

The target zone to convert to

Returns:

The converted date/time object

Type: 
ICAL.Time

(static) fromData(aData)

Creates a new ICAL.Timezone instance from the passed data object.

Parameters:
NameTypeDescription
aDataICAL.Component | Object

options for class

Properties
NameTypeDescription
componentString | ICAL.Component

If aData is a simple object, then this member can be set to either a string containing the component data, or an already parsed ICAL.Component

tzidString

The timezone identifier

locationString

The timezone locationw

tznamesString

An alternative string representation of the timezone

latitudeNumber

The latitude of the timezone

longitudeNumber

The longitude of the timezone