Reputation: 2244
I have a FullCalendar
and I want to add icons to each day. Please note that I have already done research on the issue, including these answers on SO:
this Issue is that there does not seem to be a dayRender
method.
this Works good if the events are single day. Does not work for multi-day events
this Same problem as in 1.
I have checked the Documentation of FullCalendar/Angular and the given examples
Either the method dayRender
does not exists or I am not able to call it correctly.
What I am currently doing:
<full-calendar ... (dayRender)="dayRender(date, cell)"></full-calendar>
Please note that:
Upvotes: 0
Views: 1077
Reputation: 2244
This answer only solves 2.
. I am still unable to make the icons clickable.
To achieve this functionality you need to add the event listeners like this:
(dayRender)="dayRender($event)"
Then inside of your dayRender
function, you receive an object with the following properties: date
(of type Date), el
(which is the specific element) and view
1 (of type TimeGridView).
To add an icon to each day you need something like this:
dayRender(dayToBeRendered) {
const imgElement: HTMLElement = document.createElement('img');
// add the correct attributes to your img element
dayToBeRendered.el.appendChild(divElement);
}
Upvotes: 1