1 | import type { FormatOptions } from "../lib/dateLib.js";
|
2 | import { dateLib as defaultDateLib } from "../lib/index.js";
|
3 | import type { DateLib } from "../types/index.js";
|
4 |
|
5 | /**
|
6 | * Format the weekday name to be displayed in the weekdays header.
|
7 | *
|
8 | * @defaultValue `cccccc` (e.g. "Mo" for Monday)
|
9 | * @group Formatters
|
10 | * @see https://daypicker.dev/docs/translation#custom-formatters
|
11 | */
|
12 | export function formatWeekdayName(
|
13 | weekday: Date,
|
14 | options?: FormatOptions,
|
15 | /** @ignore */
|
16 | dateLib: DateLib = defaultDateLib
|
17 | ) {
|
18 | return dateLib.format(weekday, "cccccc", options);
|
19 | }
|