UNPKG

635 BTypeScriptView Raw
1/**
2 * @name getQuarter
3 * @category Quarter Helpers
4 * @summary Get the year quarter of the given date.
5 *
6 * @description
7 * Get the year quarter of 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 given date
12 *
13 * @returns The quarter
14 *
15 * @example
16 * // Which quarter is 2 July 2014?
17 * const result = getQuarter(new Date(2014, 6, 2))
18 * //=> 3
19 */
20export declare function getQuarter<DateType extends Date>(
21 date: DateType | number | string,
22): number;