1 | import type { LabelOptions } from "../lib/dateLib.js";
|
2 | import { dateLib as defaultDateLib } from "../lib/index.js";
|
3 | import { DateLib } from "../types/index.js";
|
4 |
|
5 | /**
|
6 | * Return an ARIA label for the month grid, that will be announced when entering
|
7 | * the grid.
|
8 | *
|
9 | * @defaultValue `LLLL y` (e.g. "November 2022")
|
10 | * @group Labels
|
11 | * @see https://daypicker.dev/docs/translation#aria-labels
|
12 | */
|
13 | export function labelGrid(
|
14 | date: Date,
|
15 | options?: LabelOptions,
|
16 | /** @ignore */
|
17 | dateLib: DateLib = defaultDateLib
|
18 | ) {
|
19 | return dateLib.format(date, "LLLL y", options);
|
20 | }
|
21 |
|
22 | /**
|
23 | * @deprecated Use {@link labelGrid} instead.
|
24 | * @protected
|
25 | */
|
26 | export const labelCaption = labelGrid;
|