Files
avz-site/node_modules/react-day-picker/dist/esm/formatters/formatDay.js
T
2026-05-30 19:59:39 -03:00

17 lines
592 B
JavaScript

import { DateLib } from "../classes/DateLib.js";
/**
* Formats the day date shown in the day cell.
*
* @defaultValue `d` (e.g., "1").
* @param date The date to format.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted day as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatDay(date, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(date, "d");
}