UNPKG

839 BTypeScriptView Raw
1/**
2 * @name isThisISOWeek
3 * @category ISO Week Helpers
4 * @summary Is the given date in the same ISO week as the current date?
5 * @pure false
6 *
7 * @description
8 * Is the given date in the same ISO week as the current date?
9 *
10 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
11 *
12 * @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).
13 *
14 * @param date - The date to check
15 *
16 * @returns The date is in this ISO week
17 *
18 * @example
19 * // If today is 25 September 2014, is 22 September 2014 in this ISO week?
20 * const result = isThisISOWeek(new Date(2014, 8, 22))
21 * //=> true
22 */
23export declare function isThisISOWeek<DateType extends Date>(
24 date: DateType | number | string,
25): boolean;