1 | import type { DateLib, LabelOptions } from "../index.js";
|
2 | import { dateLib as defaultDateLib } from "../lib/index.js";
|
3 | import type { Modifiers } from "../types/index.js";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export function labelDayButton(
|
16 | date: Date,
|
17 |
|
18 | modifiers: Modifiers,
|
19 | options?: LabelOptions,
|
20 |
|
21 | dateLib: DateLib = defaultDateLib
|
22 | ) {
|
23 | let label = dateLib.format(date, "PPPP", options);
|
24 | if (modifiers.today) label = `Today, ${label}`;
|
25 | if (modifiers.selected) label = `${label}, selected`;
|
26 | return label;
|
27 | }
|
28 |
|
29 |
|
30 | export const labelDay = labelDayButton;
|