@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.
22 lines • 1.43 kB
TypeScript
import { Temporal } from "../temporal.js";
/**
* The date of `day` of `monthCode` in calendar year `year`, or null when that year has no such
* month (M05L in a common Hebrew year, M13 in iso8601) or that month no such day, and for a date
* beyond Temporal's range limit in a calendar year the limit cuts. Throws a RangeError when the
* calendar year lies wholly outside Temporal's range.
*
* Month codes are resolved as the Intl Era and Month Code proposal does (`monthOrdinal`), and the
* day is checked against the month's length, so nothing is constrained: a date that does not exist
* is `null`, as RFC 5545 §3.3.10 and RFC 7529 §4.1 skip it. The model is the owned one where the
* runtime's reads are corrected (hebrew, indian), the read-backed one otherwise.
*
* @returns the date as an ISO-calendar PlainDate, or null
*/
export declare function calendarDateFromMonthCode(calendarId: string, year: number, monthCode: string, day: number): Temporal.PlainDate | null;
/**
* The most days `monthCode` has in any year of `calendarId`: 30 for Hebrew `M01`, 6 for `M13` in
* `ethioaa`, 29 for `M02` in `islamic-civil`. It is read from the calendar over one cycle of years
* (`CYCLE_YEARS`), never from a table, and kept per calendar and month code. 0 when no year of the
* cycle has the month (`M13` in iso8601).
*/
export declare function longestDayOfMonthCode(calendarId: string, monthCode: string): number;