UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

20 lines (19 loc) 900 B
import { Temporal } from "@js-temporal/polyfill"; export interface LocaleWeekYearBounds { weekYear: number; /** First day of `weekYear`'s week 1. */ start: Temporal.PlainDate; /** First day of `weekYear + 1`'s week 1 — an exclusive upper bound. */ end: Temporal.PlainDate; } /** * Resolve the locale week-numbering year `date` belongs to, and the * `[start, end)` bounds (in calendar days) of that week-year, given a * locale's `firstDay` (1 = Monday .. 7 = Sunday) and `minimalDays` (the * minimum January days a week must have to count as week 1) — both from * `Intl.Locale.prototype.weekInfo`. * * Shared by `getLocaleWeekYear` (the year itself) and * `getWeeksInLocaleWeekYear` (the week count, derived from `start`/`end`). */ export declare function getLocaleWeekYearBounds(date: Temporal.PlainDate, firstDay: number, minimalDays: number): LocaleWeekYearBounds;