UNPKG

1.02 kBTypeScriptView Raw
1/**
2 * @name subISOWeekYears
3 * @category ISO Week-Numbering Year Helpers
4 * @summary Subtract the specified number of ISO week-numbering years from the given date.
5 *
6 * @description
7 * Subtract the specified number of ISO week-numbering years from 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 subtracted.
15 *
16 * @returns The new date with the ISO week-numbering years subtracted
17 *
18 * @example
19 * // Subtract 5 ISO week-numbering years from 1 September 2014:
20 * const result = subISOWeekYears(new Date(2014, 8, 1), 5)
21 * //=> Mon Aug 31 2009 00:00:00
22 */
23export declare function subISOWeekYears<DateType extends Date>(
24 date: DateType | number | string,
25 amount: number,
26): DateType;