Skip to content

Show only first 3 letters of a month, how to do it? #1783

Answered by gpbl
GenatHadri asked this question in Support
Discussion options

You must be logged in to vote

Hi @GenatHadri! Where do you want to show the first 3 letters? If it is in the caption, you can pass a formatCaption function to the formatters prop:

<DayPicker
  formatters={{
    formatCaption: (date) => format(date, "MMM yyyy").toUpperCase()
  }}
/>

Example: https://codesandbox.io/s/react-daypicker-forked-djmu70?file=/src/App.tsx

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gpbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1782 on May 02, 2023 21:52.