UNPKG

754 BTypeScriptView Raw
1/**
2 * @name lastDayOfDecade
3 * @category Decade Helpers
4 * @summary Return the last day of a decade for the given date.
5 *
6 * @description
7 * Return the last day 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 last day of a decade
14 *
15 * @example
16 * // The last day of a decade for 21 December 2012 21:12:00:
17 * const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))
18 * //=> Wed Dec 31 2019 00:00:00
19 */
20export declare function lastDayOfDecade<DateType extends Date>(
21 date: DateType | number | string,
22): DateType;