UNPKG

735 BTypeScriptView Raw
1/**
2 * @name getISOWeek
3 * @category ISO Week Helpers
4 * @summary Get the ISO week of the given date.
5 *
6 * @description
7 * Get the ISO week of the given date.
8 *
9 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
10 *
11 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
12 *
13 * @param date - The given date
14 *
15 * @returns The ISO week
16 *
17 * @example
18 * // Which week of the ISO-week numbering year is 2 January 2005?
19 * const result = getISOWeek(new Date(2005, 0, 2))
20 * //=> 53
21 */
22export declare function getISOWeek<DateType extends Date>(
23 date: DateType | number | string,
24): number;