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