UNPKG

986 BTypeScriptView Raw
1/**
2 * @name addISOWeekYears
3 * @category ISO Week-Numbering Year Helpers
4 * @summary Add the specified number of ISO week-numbering years to the given date.
5 *
6 * @description
7 * Add the specified number of ISO week-numbering years to 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 date to be changed
14 * @param amount - The amount of ISO week-numbering years to be added.
15 *
16 * @returns The new date with the ISO week-numbering years added
17 *
18 * @example
19 * // Add 5 ISO week-numbering years to 2 July 2010:
20 * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
21 * //=> Fri Jn 26 2015 00:00:00
22 */
23export declare function addISOWeekYears<DateType extends Date>(
24 date: DateType | number | string,
25 amount: number,
26): DateType;