UNPKG

933 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.labelDay = void 0;
4exports.labelDayButton = labelDayButton;
5const index_js_1 = require("../lib/index.js");
6/**
7 * The ARIA label for the day button.
8 *
9 * Use the `modifiers` argument to add additional context to the label, e.g.
10 * when a day is selected or is today.
11 *
12 * @defaultValue The formatted date.
13 * @group Labels
14 * @see https://daypicker.dev/docs/translation#aria-labels
15 */
16function labelDayButton(date,
17/** The modifiers for the day. */
18modifiers, options,
19/** @ignore */
20dateLib = index_js_1.dateLib) {
21 let label = dateLib.format(date, "PPPP", options);
22 if (modifiers.today)
23 label = `Today, ${label}`;
24 if (modifiers.selected)
25 label = `${label}, selected`;
26 return label;
27}
28/** @deprecated Use `labelDayButton` instead. */
29exports.labelDay = labelDayButton;
30//# sourceMappingURL=labelDayButton.js.map
\No newline at end of file