Luxon Manual Reference
import IANAZone from 'luxon/src/zones/IANAZone.js'
public class | source

IANAZone

Extends:

Zone → IANAZone

Implements:

A zone identified by an IANA identifier, like America/New_York

Static Method Summary

Static Public Methods
public static
public static

Returns whether the provided string is a valid specifier.

public static

Returns whether the provided string identifies a real zone

public static

resetCache(): void

Reset local caches.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

isValid: *

public get

name: *

public get
public get

Method Summary

Public Methods
public

equals(otherZone: *): *

public

formatOffset(ts: *, format: *): *

public

offset(ts: *): *

public

offsetName(ts: *, objectPattern1: {"format": *, "locale": *}): *

Inherited Summary

From class Zone
public get abstract

Return whether this Zone is valid.

public get abstract

The name of this zone.

public get abstract

The type of zone

public get abstract

Returns whether the offset is known to be fixed for the whole year.

public abstract

equals(otherZone: Zone): boolean

Return whether this Zone is equal to another zone

public abstract

formatOffset(ts: number, format: string): string

Returns the offset's value as a string

public abstract

Return the offset in minutes for this zone at the specified timestamp.

public abstract

Returns the offset's common name (such as EST) at the specified timestamp

Static Public Methods

public static create(name: string): IANAZone source

Params:

NameTypeAttributeDescription
name string

Zone name

Return:

IANAZone

public static isValidSpecifier(s: string): boolean source

Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.

Params:

NameTypeAttributeDescription
s string

The string to check validity on

Return:

boolean

Example:

IANAZone.isValidSpecifier("America/New_York") //=> true
IANAZone.isValidSpecifier("Fantasia/Castle") //=> true
IANAZone.isValidSpecifier("Sport~~blorp") //=> false

public static isValidZone(zone: string): boolean source

Returns whether the provided string identifies a real zone

Params:

NameTypeAttributeDescription
zone string

The string to check

Return:

boolean

Example:

IANAZone.isValidZone("America/New_York") //=> true
IANAZone.isValidZone("Fantasia/Castle") //=> false
IANAZone.isValidZone("Sport~~blorp") //=> false

public static resetCache(): void source

Reset local caches. Should only be necessary in testing scenarios.

Return:

void

Public Constructors

public constructor() source

Public Members

public get isValid: * source

Return whether this Zone is valid.

Override:

Zone#isValid

public get name: * source

The name of this zone.

Override:

Zone#name

public get type: string source

The type of zone

Override:

Zone#type

public get universal: boolean source

Returns whether the offset is known to be fixed for the whole year.

Override:

Zone#universal

Public Methods

public equals(otherZone: *): * source

Return whether this Zone is equal to another zone

Override:

Zone#equals

Params:

NameTypeAttributeDescription
otherZone *

Return:

*

public formatOffset(ts: *, format: *): * source

Returns the offset's value as a string

Override:

Zone#formatOffset

Params:

NameTypeAttributeDescription
ts *
format *

Return:

*

public offset(ts: *): * source

Return the offset in minutes for this zone at the specified timestamp.

Override:

Zone#offset

Params:

NameTypeAttributeDescription
ts *

Return:

*

public offsetName(ts: *, objectPattern1: {"format": *, "locale": *}): * source

Returns the offset's common name (such as EST) at the specified timestamp

Override:

Zone#offsetName

Params:

NameTypeAttributeDescription
ts *
objectPattern1 {"format": *, "locale": *}
  • default: {"format":null,"locale":null}

Return:

*