Home Reference Source Repository
import {ZoneIdPrinterParser} from 'js-joda/src/format/parser/ZoneIdPrinterParser.js'
public class | source

ZoneIdPrinterParser

Prints or parses a zone ID.

Constructor Summary

Public Constructor
public

constructor(query: TemporalQuery, description: string)

Member Summary

Public Members
public
public

query: *

Method Summary

Public Methods
public

parse(context: DateTimeParseContext, text: String, position: number): number

This implementation looks for the longest matching string.

public

print(context: DateTimePrintContext , buf: StringBuilder): boolean

public

Public Constructors

public constructor(query: TemporalQuery, description: string) source

Params:

NameTypeAttributeDescription
query TemporalQuery
description string

Public Members

public description: * source

public query: * source

Public Methods

public parse(context: DateTimeParseContext, text: String, position: number): number source

This implementation looks for the longest matching string. For example, parsing Etc/GMT-2 will return Etc/GMC-2 rather than just Etc/GMC although both are valid.

This implementation uses a tree to search for valid time-zone names in the parseText. The top level node of the tree has a length equal to the length of the shortest time-zone as well as the beginning characters of all other time-zones.

Params:

NameTypeAttributeDescription
context DateTimeParseContext
text String
position number

Return:

number

public print(context: DateTimePrintContext , buf: StringBuilder): boolean source

Params:

NameTypeAttributeDescription
context DateTimePrintContext
buf StringBuilder

Return:

boolean

public toString(): string source

Return:

string