You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add formatDateDisplay prop for custom date formatting
Adds a new `formatDateDisplay` prop that accepts `(date: Date) => string`
for custom input display formatting (e.g. Intl.DateTimeFormat).
Unlike overloading `dateFormat`, this approach preserves the existing
parsing behavior — `dateFormat` continues to handle typed input parsing
while `formatDateDisplay` only controls the displayed value.
Works with single dates, date ranges, multiple dates, and the
`formatMultipleDates` callback.
Copy file name to clipboardExpand all lines: src/index.tsx
+22-16Lines changed: 22 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,6 @@ import {
31
31
parseDateForNavigation,
32
32
formatDate,
33
33
safeDateFormat,
34
-
safeDateRangeFormat,
35
34
getHighLightDaysMap,
36
35
getYear,
37
36
getMonth,
@@ -172,6 +171,8 @@ export type DatePickerProps = OmitUnion<
172
171
className?: string;
173
172
customInput?: Parameters<typeofcloneElement>[0];
174
173
dateFormat?: string|string[];
174
+
/** Custom function to format dates for input display. When provided, overrides dateFormat for display only — dateFormat is still used for parsing typed input. */
0 commit comments