UNPKG

1.08 kBTypeScriptView Raw
1import type { ContextOptions, DateArg } from "./types.js";
2/**
3 * The {@link isSameQuarter} function options.
4 */
5export interface IsSameQuarterOptions extends ContextOptions<Date> {}
6/**
7 * @name isSameQuarter
8 * @category Quarter Helpers
9 * @summary Are the given dates in the same quarter (and year)?
10 *
11 * @description
12 * Are the given dates in the same quarter (and year)?
13 *
14 * @param laterDate - The first date to check
15 * @param earlierDate - The second date to check
16 * @param options - An object with options
17 *
18 * @returns The dates are in the same quarter (and year)
19 *
20 * @example
21 * // Are 1 January 2014 and 8 March 2014 in the same quarter?
22 * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))
23 * //=> true
24 *
25 * @example
26 * // Are 1 January 2014 and 1 January 2015 in the same quarter?
27 * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1))
28 * //=> false
29 */
30export declare function isSameQuarter(
31 laterDate: DateArg<Date> & {},
32 earlierDate: DateArg<Date> & {},
33 options?: IsSameQuarterOptions | undefined,
34): boolean;