UNPKG

1.05 kBTypeScriptView Raw
1/**
2 * @name differenceInISOWeekYears
3 * @category ISO Week-Numbering Year Helpers
4 * @summary Get the number of full ISO week-numbering years between the given dates.
5 *
6 * @description
7 * Get the number of full ISO week-numbering years between the given dates.
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 dateLeft - The later date
14 * @param dateRight - The earlier date
15 *
16 * @returns The number of full ISO week-numbering years
17 *
18 * @example
19 * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
20 * const result = differenceInISOWeekYears(
21 * new Date(2012, 0, 1),
22 * new Date(2010, 0, 1)
23 * )
24 * //=> 1
25 */
26export declare function differenceInISOWeekYears<DateType extends Date>(
27 dateLeft: DateType | number | string,
28 dateRight: DateType | number | string,
29): number;