Customise week numbers in react-calendar

218 Views Asked by At

I'm using react-calendar to create a customised calendar. Is it possible to replace default week numbers with custom week numbers?

<Calendar
       calendarType="US"
       onChange={handleDateChange}
       showWeekNumbers
       onClickWeekNumber={handleWeekClick}
       selectRange
       value={[new Date(selectedStartDate), new Date(selectedEndDate)]}
       defaultValue={[
           new Date(selectedStartDate),
           new Date(selectedEndDate),
        ]}
       formatShortWeekday={(_locale, date) => weekday[date.getDay()]}
/>

I was not able to find any documentation or examples on how this can be achieved. I could add the custom week numbers separately beside the calendar but they would not be clickable and would not highlight the dates in the calendar.

0

There are 0 best solutions below