UNPKG

716 BTypeScriptView Raw
1/**
2 * @name endOfDecade
3 * @category Decade Helpers
4 * @summary Return the end of a decade for the given date.
5 *
6 * @description
7 * Return the end of a decade for the given date.
8 *
9 * @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).
10 *
11 * @param date - The original date
12 *
13 * @returns The end of a decade
14 *
15 * @example
16 * // The end of a decade for 12 May 1984 00:00:00:
17 * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))
18 * //=> Dec 31 1989 23:59:59.999
19 */
20export declare function endOfDecade<DateType extends Date>(
21 date: DateType | number | string,
22): DateType;