UNPKG

786 BTypeScriptView Raw
1/**
2 * @name endOfQuarter
3 * @category Quarter Helpers
4 * @summary Return the end of a year quarter for the given date.
5 *
6 * @description
7 * Return the end of a year quarter for the given date.
8 * The result will be in the local timezone.
9 *
10 * @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).
11 *
12 * @param date - The original date
13 *
14 * @returns The end of a quarter
15 *
16 * @example
17 * // The end of a quarter for 2 September 2014 11:55:00:
18 * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
19 * //=> Tue Sep 30 2014 23:59:59.999
20 */
21export declare function endOfQuarter<DateType extends Date>(
22 date: DateType | number | string,
23): DateType;