I have a react-big-calendar and I want to get same informations like the day and the start and the end (as a time) for coloring the time and the day slot with slotPropGetter.
My informations from the backend is:
{ "start": "2019-08-23T13:30:00",
"end": "2019-08-23T18:00:00",
"rendering": "background",
"color": "#f740f7"
}
I try with slotPropGetter
:
slotPropGetter={
(date) => {
for(let i =0; i<this.state.eventsPlanning.length; i++) {
if(this.state.eventsPlanning[i].rendering === 'background') {
let newStyle ={
backgroundColor:'red'
}
return {
className: "rbc-day-slot rbc-time-slot",
style: newStyle
}
}
}
}
}
when I run it, it seems all the days are colored, but I want just to color according the start
and the end
of the informations.
How can I fix that ?