@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.
12 lines • 617 B
TypeScript
import { Temporal } from "./temporal.js";
/**
* Return the PlainDate for the next/previous occurrence of `dayOfWeek` relative to `date`.
*
* @param date starting PlainDate
* @param dayOfWeek target ISO day of week (1-7)
* @param direction 1 to search forward (next), -1 to search backward (previous)
* @param inclusive when `date` already falls on `dayOfWeek`, return it as-is instead of
* advancing a full week
* @returns PlainDate for the resolved weekday
*/
export declare function advanceToWeekday(date: Temporal.PlainDate, dayOfWeek: number, direction: 1 | -1, inclusive: boolean): Temporal.PlainDate;