FullCalendar - Display Icon On Each Day Based On Event Criteria
I am using FullCalendar. I would like to display an icon in each day cell that matches certain event criteria. More specifically, I would like to display a warning & tooltip
Solution 1:
Day cells in the month view are rendered like this:
<td class="fc-day-top fc-thu fc-past" data-date="2017-11-02">
Therefore you can find a particular day cell quite easily:
$('.fc-day-top[data-date="2017-11-02"]')
Within the eventRender callback, you can use the event's start time to make this dynamically relate to the correct day for the event:
eventRender: function(event, element)
{
$('.fc-day-top[data-date="' + event.start.format("YYYY-MM-DD") + '"]').append("Hi");
},
See http://jsfiddle.net/sbxpv25p/68/ for a working example.
You may append anything you like in place of "Hi", of course.
Note that, as per the working example, this still has the drawback that it may append the same thing more than once, if there are multiple events on a given day.
Post a Comment for "FullCalendar - Display Icon On Each Day Based On Event Criteria"