Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
817 B
Text
25 lines
817 B
Text
import * as defaultFormatters from "../formatters/index.js";
|
|
import type { DayPickerProps } from "../types/index.js";
|
|
|
|
/**
|
|
* Merges custom formatters from the props with the default formatters.
|
|
*
|
|
* @param customFormatters The custom formatters provided in the DayPicker
|
|
* props.
|
|
* @returns The merged formatters object.
|
|
*/
|
|
export function getFormatters(customFormatters: DayPickerProps["formatters"]) {
|
|
if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
|
|
customFormatters.formatCaption = customFormatters.formatMonthCaption;
|
|
}
|
|
if (
|
|
customFormatters?.formatYearCaption &&
|
|
!customFormatters.formatYearDropdown
|
|
) {
|
|
customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
|
|
}
|
|
return {
|
|
...defaultFormatters,
|
|
...customFormatters
|
|
};
|
|
}
|