import {ZoneIdPrinterParser} from 'js-joda/src/format/parser/ZoneIdPrinterParser.js'
ZoneIdPrinterParser
Prints or parses a zone ID.
Constructor Summary
Public Constructor | ||
public |
constructor(query: TemporalQuery, description: string) |
Member Summary
Public Members | ||
public |
description: * |
|
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:
Name | Type | Attribute | Description |
query | TemporalQuery | ||
description | string |
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:
Name | Type | Attribute | Description |
context | DateTimeParseContext | ||
text | String | ||
position | number |
public print(context: DateTimePrintContext , buf: StringBuilder): boolean source
Params:
Name | Type | Attribute | Description |
context | DateTimePrintContext | ||
buf | StringBuilder |