UNPKG

989 BTypeScriptView Raw
1/**
2 * @name lastDayOfISOWeekYear
3 * @category ISO Week-Numbering Year Helpers
4 * @summary Return the last day of an ISO week-numbering year for the given date.
5 *
6 * @description
7 * Return the last day of an ISO week-numbering year,
8 * which always starts 3 days before the year's first Thursday.
9 * The result will be in the local timezone.
10 *
11 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
12 *
13 * @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).
14 *
15 * @param date - The original date
16 *
17 * @returns The end of an ISO week-numbering year
18 *
19 * @example
20 * // The last day of an ISO week-numbering year for 2 July 2005:
21 * const result = lastDayOfISOWeekYear(new Date(2005, 6, 2))
22 * //=> Sun Jan 01 2006 00:00:00
23 */
24export declare function lastDayOfISOWeekYear<DateType extends Date>(
25 date: DateType | number | string,
26): DateType;