UNPKG

995 BTypeScriptView Raw
1/**
2 * @name differenceInCalendarISOWeeks
3 * @category ISO Week Helpers
4 * @summary Get the number of calendar ISO weeks between the given dates.
5 *
6 * @description
7 * Get the number of calendar ISO weeks 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 calendar ISO weeks
17 *
18 * @example
19 * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
20 * const result = differenceInCalendarISOWeeks(
21 * new Date(2014, 6, 21),
22 * new Date(2014, 6, 6)
23 * )
24 * //=> 3
25 */
26export declare function differenceInCalendarISOWeeks<DateType extends Date>(
27 dateLeft: DateType | number | string,
28 dateRight: DateType | number | string,
29): number;