UNPKG

@technobuddha/library

Version:
31 lines (30 loc) 926 B
import { type DayOfWeek } from './date.ts'; /** * Options for the {@link isoWeekOfYear} function * @group Time * @category Week */ export type ISOWeekOfYearOptions = { /** 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; /** The first day of the week */ firstDayOfWeek?: DayOfWeek; }; /** * Determine the ISO week number for a given date * @param input - The date * @param options - see {@link ISOWeekOfYearOptions} * @defaultValue weekOneIncludes Thursday * @defaultValue firstDayOfWeek Monday * @returns the week number (1-53) * @group Time * @category Week */ export declare function isoWeekOfYear(input: Date, { utc, weekOneIncludes, firstDayOfWeek, }?: ISOWeekOfYearOptions): { /** The year */ year: number; /** The ISO week number */ week: number; };