ICAL. UtcOffset

This class represents the "utc-offset" value type, with various calculation and manipulation methods.

Constructor

new UtcOffset(aData)

Creates a new ICAL.UtcOffset instance.

Parameters:
NameTypeDescription
aDataObject

An object with members of the utc offset

Properties
NameTypeAttributesDescription
hoursNumber<optional>

The hours for the utc offset

minutesNumber<optional>

The minutes in the utc offset

factorNumber<optional>

The factor for the utc-offset, either -1 or 1

Members

factor :Number

The sign of the utc offset, 1 for positive offset, -1 for negative offsets.

Type:
  • Number

hours :Number

The hours in the utc-offset

Type:
  • Number

(constant) icaltype :String

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

Type:
  • String
Default Value
  • "utc-offset"

minutes :Number

The minutes in the utc-offset

Type:
  • Number

Methods

clone() → {ICAL.UtcOffset}

Returns a clone of the utc offset object.

Returns:

The cloned object

Type: 
ICAL.UtcOffset

compare(other) → {Number}

Compare this utc offset with another one.

Parameters:
NameTypeDescription
otherICAL.UtcOffset

The other offset to compare with

Returns:

-1, 0 or 1 for less/equal/greater

Type: 
Number

fromData(aData)

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

Parameters:
NameTypeDescription
aDataObject

An object with members of the utc offset

Properties
NameTypeAttributesDescription
hoursNumber<optional>

The hours for the utc offset

minutesNumber<optional>

The minutes in the utc offset

factorNumber<optional>

The factor for the utc-offset, either -1 or 1

fromSeconds(aSeconds)

Sets up the current instance from the given seconds value. The seconds value is truncated to the minute. Offsets are wrapped when the world ends, the hour after UTC+14:00 is UTC-12:00.

Parameters:
NameTypeDescription
aSecondsNumber

The seconds to convert into an offset

toICALString() → {String}

The iCalendar string representation of this utc-offset.

Returns:
Type: 
String

toSeconds() → {Number}

Convert the current offset to a value in seconds

Returns:

The offset in seconds

Type: 
Number

toString() → {String}

The string representation of this utc-offset.

Returns:
Type: 
String

(static) fromSeconds(aSeconds)

Creates a new ICAL.UtcOffset instance from the passed seconds value.

Parameters:
NameTypeDescription
aSecondsNumber

The number of seconds to convert

(static) fromString(aString) → {ICAL.Duration}

Creates a new ICAL.UtcOffset instance from the passed string.

Parameters:
NameTypeDescription
aStringString

The string to parse

Returns:

The created utc-offset instance

Type: 
ICAL.Duration