1 | import * as defaultFormatters from "../formatters/index.js";
|
2 | import type { DayPickerProps } from "../types/index.js";
|
3 |
|
4 |
|
5 | export function getFormatters(customFormatters: DayPickerProps["formatters"]) {
|
6 | if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
|
7 | customFormatters.formatCaption = customFormatters.formatMonthCaption;
|
8 | }
|
9 | if (
|
10 | customFormatters?.formatYearCaption &&
|
11 | !customFormatters.formatYearDropdown
|
12 | ) {
|
13 | customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
|
14 | }
|
15 | return {
|
16 | ...defaultFormatters,
|
17 | ...customFormatters
|
18 | };
|
19 | }
|