UNPKG

858 BTypeScriptView Raw
1/**
2 * @name getISOWeeksInYear
3 * @category ISO Week-Numbering Year Helpers
4 * @summary Get the number of weeks in an ISO week-numbering year of the given date.
5 *
6 * @description
7 * Get the number of weeks in an ISO week-numbering year 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 number of ISO weeks in a year
16 *
17 * @example
18 * // How many weeks are in ISO week-numbering year 2015?
19 * const result = getISOWeeksInYear(new Date(2015, 1, 11))
20 * //=> 53
21 */
22export declare function getISOWeeksInYear<DateType extends Date>(
23 date: DateType | number | string,
24): number;