UNPKG

515 BPlain TextView Raw
1import type { FormatOptions } from "../lib/dateLib.js";
2import { dateLib as defaultDateLib } from "../lib/index.js";
3import type { DateLib } from "../types/index.js";
4
5/**
6 * Format the day date shown in the day cell.
7 *
8 * @defaultValue `d` (e.g. "1")
9 * @group Formatters
10 * @see https://daypicker.dev/docs/translation#custom-formatters
11 */
12export function formatDay(
13 date: Date,
14 options?: FormatOptions,
15 /** @ignore */
16 dateLib: DateLib = defaultDateLib
17) {
18 return dateLib.format(date, "d", options);
19}