So as seen on the picture, I want to style individual events.
With the slotpropgetter it's possible to conditionally render styles.
slotPropGetter = date => {
const CURRENT_DATE = moment().toDate();
let backgroundColor;
if (moment(date).isBefore(CURRENT_DATE, "month")) {
backgroundColor = "#f7f8f9";
}
var style = {
backgroundColor
};
return {
style: style
};
};
So the "solution" is the DateCellWrapper, it either doesn't work for me, or I've implemented it in the wrong way
const DateCellWrapper = ({ value, children }) => {
console.log("DateCellWrapper")
const style = {
backgroundColor: "#000",
};
return (
<div style={style}>{children}</div>
);
}
It doesn't even output my console.log, so.. anyone an idea? :p
The
components
prop can be used to individually change how parts of the calendar are rendered:Working Example:
It has the following type definition: