UNPKG

671 BTypeScriptView Raw
1import type { ContextOptions, DateArg } from "./types.js";
2/**
3 * The {@link getMonth} function options.
4 */
5export interface GetMonthOptions extends ContextOptions<Date> {}
6/**
7 * @name getMonth
8 * @category Month Helpers
9 * @summary Get the month of the given date.
10 *
11 * @description
12 * Get the month of the given date.
13 *
14 * @param date - The given date
15 * @param options - An object with options
16 *
17 * @returns The month index (0-11)
18 *
19 * @example
20 * // Which month is 29 February 2012?
21 * const result = getMonth(new Date(2012, 1, 29))
22 * //=> 1
23 */
24export declare function getMonth(
25 date: DateArg<Date> & {},
26 options?: GetMonthOptions | undefined,
27): number;