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.

16 lines • 859 B
import { Temporal } from "./temporal.js"; import { RollConvention } from "../types/roll-convention.js"; import "../types/index.js"; import { ResolvedBusinessCalendar } from "./businessCalendar.js"; /** * Move a date onto a working day according to `convention`, over an already-parsed calendar. * The core of `rollDate` and `cutoffAt`; neither calls the other. * * @param date the date to roll * @param convention the roll convention, already validated * @param calendar the parsed business calendar * @returns the rolled date, or `null` when the walk runs out * * @example rollBusinessDate(Temporal.PlainDate.from("2024-06-01"), "following", calendar) // 2024-06-03 (Saturday to Monday) */ export declare function rollBusinessDate(date: Temporal.PlainDate, convention: RollConvention, calendar: ResolvedBusinessCalendar): Temporal.PlainDate | null;