@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.
25 lines • 1.12 kB
TypeScript
import { TwoDigitYearOptions } from "../types/two-digit-year.js";
import { NotamValidity } from "../types/notam.js";
/** The fields of an item B) or C) value: `PERM`, or a `YYMMDDHHMM` group with its `EST` flag. */
export type NotamDateTimeFields = {
kind: "permanent";
} | {
kind: "dateTime";
yy: number;
month: number;
day: number;
hour: number;
minute: number;
estimated: boolean;
};
/** Read an item B) or C) value, or null when the shape does not match. */
export declare function readNotamDateTimeFields(value: string): NotamDateTimeFields | null;
/**
* The core of `parseNotamValidity` and `isValidNotamValidity`: the instant an item B) or C) value
* names, with its two-digit year placed by the caller's `yearWindow` option; `PERM` as itself.
* Never throws.
*
* @example readNotamValidity("2403151200", { yearWindow: 2000 }) // { kind: "instant", instant: "2024-03-15T12:00:00Z", estimated: false }
* @example readNotamValidity("2413151200", { yearWindow: 2000 }) // null
*/
export declare function readNotamValidity(value: string, options: TwoDigitYearOptions): NotamValidity | null;