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.

14 lines • 917 B
/** * Whether a formatter prints a year, month, day or era: its resolved options carry `dateStyle`, * `era`, `year`, `month` or `day`, or its parts for one instant hold one of them (`relatedYear` * and `yearName` count as a year). A time-only or weekday-only formatter prints none: the time of * day and the seven-day week do not depend on the calendar (ECMA-402 ToLocalTime). * * @param formatter the formatter * @param resolved its `resolvedOptions()` * @returns `true` when it prints a date field * * @example printsDateField(new Intl.DateTimeFormat("en"), new Intl.DateTimeFormat("en").resolvedOptions()) // true * @example printsDateField(new Intl.DateTimeFormat("en", { weekday: "long" }), new Intl.DateTimeFormat("en", { weekday: "long" }).resolvedOptions()) // false */ export declare function printsDateField(formatter: Intl.DateTimeFormat, resolved: Intl.ResolvedDateTimeFormatOptions): boolean;