I'm trying to change the backgroundColor of specific days.
Ideally I would like to change the background color for the days that contain events on them but in this particular case because I'm testing the library I'm just trying with the 16th day:
const dayPropGetter = useCallback(
(date) => {
return {
...(DateTime.local(date).day === 16 && { style: { backgroundColor: 'blue' }})
}
}
, [])
My code should make the background color of the 16th day on my calendar to be blue, it is almost the same as the example they put in the docs however nothing happens.
This is my calendar component:
<Calendar
localizer={localizer}
views={['month']}
dayPropGetter={dayPropGetter}
events={events}
style={{height: 500}}
/>