UNPKG

1 kBTypeScriptView Raw
1import type { ContextOptions, DateArg } from "./types.js";
2/**
3 * The {@link differenceInCalendarMonths} function options.
4 */
5export interface DifferenceInCalendarMonthsOptions
6 extends ContextOptions<Date> {}
7/**
8 * @name differenceInCalendarMonths
9 * @category Month Helpers
10 * @summary Get the number of calendar months between the given dates.
11 *
12 * @description
13 * Get the number of calendar months between the given dates.
14 *
15 * @param laterDate - The later date
16 * @param earlierDate - The earlier date
17 * @param options - An object with options
18 *
19 * @returns The number of calendar months
20 *
21 * @example
22 * // How many calendar months are between 31 January 2014 and 1 September 2014?
23 * const result = differenceInCalendarMonths(
24 * new Date(2014, 8, 1),
25 * new Date(2014, 0, 31)
26 * )
27 * //=> 8
28 */
29export declare function differenceInCalendarMonths(
30 laterDate: DateArg<Date> & {},
31 earlierDate: DateArg<Date> & {},
32 options?: DifferenceInCalendarMonthsOptions | undefined,
33): number;