In order to fulfill design requirements a custom icon/text has to be shown in the top left corner of a FullCalendar with timeGridWeek and resourceTimeGridDay views.
I have tried but maybe it is not possible, BTW I am under FullCalendar v5 and React 17*
So just to make myself clear, I want in this sample:
initialView: 'timeGridWeek',
To set custom content on the top-left cell, like a map legend.
After following some suggestions here I ended up like:
viewDidMount={({ el }: {el:any}) => { const topLeftCorner = el.querySelector('.fc-timegrid-axis-frame'); ReactDOM.render(<div className="fullcalendar-top-left-icon"><WhateverAntdIcon /></div>, topLeftCorner)}}
But since I also have dayMinWidth prop my approach only works for desktop so far. I still have to find a way to make it work for mobile or use the css approach and install awesomefont.
Finally I did it with FontAwesome as @levi suggested, thanks!. I just added the @font-face to avoid overloading my bundle:
@font-face {
font-family: "FontAwesome";
font-weight: normal;
font-style : normal;
src : url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?v=4.3.0");
src : url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0") format("embedded-opentype"),
url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.woff2?v=4.3.0") format("woff2"),
url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.woff?v=4.3.0") format("woff"),
url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.ttf?v=4.3.0") format("truetype"),
url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular") format("svg");
}
.fc-timegrid-axis-frame::before { {
font-family: FontAwesome;
content: "\f024";
}