Skip to content

Commit 4b2d193

Browse files
committed
chore: replace type using date-fns format
1 parent 5b01cb6 commit 4b2d193

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/experimental/Calendar/Calendar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import * as Styled from './Calendar.styled';
1212

1313
export type Range = RdpRange;
1414

15+
type DateFnsFormatOptions = Parameters<typeof format>[2];
16+
1517
type BaseProps = Omit<React.ComponentProps<typeof DayPicker>, 'mode' | 'selected' | 'onSelect'> & {
1618
visibleMonths?: 1 | 2 | 3;
1719
captionLayout?: React.ComponentProps<typeof DayPicker>['captionLayout'];
@@ -71,9 +73,7 @@ export function Calendar(props: CalendarProps): JSX.Element {
7173
weekStartsOn,
7274
captionLayout,
7375
formatters: {
74-
formatWeekdayName: (date, options?: { locale: unknown }) =>
75-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
76-
format(date, 'eee', { locale: (options as any)?.locale })
76+
formatWeekdayName: (date, options?: DateFnsFormatOptions) => format(date, 'eee', options)
7777
},
7878
classNames: { ...defaults, ...classNames },
7979
components: {

0 commit comments

Comments
 (0)