1

I have to capitalize the first letter of the month in which I'm in on the calendar. For example, on the top of the calendar it says noviembre and it should read Noviembre.view of the calendar component

I console logged the date that comes as props and is a standard DATE format. Also, I tried changing the view value to other options but that changes the title of the calendar.

EDIT: So i didnt copied the code so here is the calendar component

<ReactCalendar
  className="h-auto w-full py-6 px-4"
  value={dateValue}
  maxDate={dayjs().add(90, 'days').toDate()}
  next2Label={null}
  locale='es-ES'
  formatShortWeekday={(locale, dateValue) =>
    ['D', 'L', 'M', 'M', 'J', 'V', 'S'][dateValue.getDay()]
  }
  prev2Label={null}
  view="month"
  minDate={dayjs().toDate()}
  tileDisabled={date =>
    day ? disabledDays(date.date.toString().toLowerCase()) : false
  }
  tileContent={({ date }) => handleTileContent(date)}
  onClickDay={date => setDateValue(date)}
/>
  • check the doc of the calendar component you're using. You can probably manipulate that using some props – asma Nov 14 '22 at 15:06
  • you can use `PascalCase` function as a wrapper for your date picker – Saeed Mansoori Nov 14 '22 at 15:08
  • Please take the [tour] and read [ask] for tips on asking questions less likely to be closed. In this case, a [mre] is needed to show the code you are currently using so that others can reproduce the issue and provide code that can help you. – Heretic Monkey Nov 14 '22 at 15:09

1 Answers1

0

try using this props

formatMonth={(locale, date) => formatDate(date, 'MMM')}
asma
  • 599
  • 1
  • 7
  • 19