UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

31 lines • 1.24 kB
import { X12NamedZone, X12TimeCodeClass } from "../types/edi.js"; /** * The core of `x12TimeCodeOffset`: the `±HH:MM` offset an X12 time code names. * * @param timeCode an X12 data element 623 code * @returns the offset, or `""` for any value that is not an offset code * * @example x12OffsetOf("27") // "+05:30" * @example x12OffsetOf("ET") // "" */ export declare function x12OffsetOf(timeCode: unknown): string; /** * The core of `x12TimeCodeZone`: the named zone an X12 time code names. * * @param timeCode an X12 data element 623 code * @returns a copy of the zone, or `null` for any value that is not a zone-name code * * @example x12ZoneOf("ED") // { zone: "Eastern", daylight: true } * @example x12ZoneOf("27") // null */ export declare function x12ZoneOf(timeCode: unknown): X12NamedZone | null; /** * The core of `classifyX12TimeCode`: whether a code is an offset code or a zone-name code. * * @param timeCode an X12 data element 623 code * @returns the class, or `null` for any other value * * @example classifyX12TimeCodeOf("27") // { kind: "offset", timeCode: "27" } * @example classifyX12TimeCodeOf("XX") // null */ export declare function classifyX12TimeCodeOf(timeCode: string): X12TimeCodeClass | null;