Is there a way to remove year in header title #1842
Answered
by
gpbl
isaacdarcilla
asked this question in
Support
-
I want to just set the title to "July" |
Beta Was this translation helpful? Give feedback.
Answered by
gpbl
Jul 20, 2023
Replies: 1 comment
-
@isaacdarcilla yes, use a https://codesandbox.io/s/pensive-poitras-5dn8yg?file=/App.tsx import { DateFormatter, DayPicker } from "react-day-picker";
import { format } from "date-fns";
const formatCaption: DateFormatter = (month, options) => {
return format(month, "LLLL", options);
};
function App() {
return <DayPicker formatters={{ formatCaption }} />;
} (Consider hiding the year is not a good practice for birthday dates: https://www.smashingmagazine.com/2021/05/frustrating-design-patterns-birthday-picker/) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gpbl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@isaacdarcilla yes, use a
formatCaption
formatter:https://codesandbox.io/s/pensive-poitras-5dn8yg?file=/App.tsx
(Consider hiding the year is not a good practice for birthday dates: https://www.smashingmagazine.com/2021/05/frustrating-design-patterns-birthday-picker/)