@technobuddha/library
Version:
A large library of useful functions
24 lines (23 loc) • 798 B
TypeScript
import { type DayOfWeek } from './constants.ts';
/**
* Options for the {@link getISOWeeksInYear} function
* @group Time
* @category Week
*/
export type ISOWeeksInYearOptions = {
/** Use the utc timezone */
utc?: boolean;
/** Week 1 is defined as the week with the Gregorian year's first [weekOneIncludes] day in it */
weekOneIncludes?: DayOfWeek;
};
/**
* Determine the number of ISO weeks within a year
*
* @param input - A date within the year, or a year number
* @param options - see {@link ISOWeeksInYearOptions}
* @defaultValue weekOneIncludes Thursday
* @returns The number of weeks in the year (52 or 53)
* @group Time
* @category Week
*/
export declare function getISOWeeksInYear(input: Date | number, { utc, weekOneIncludes }?: ISOWeeksInYearOptions): number;