Add custom text to event in Day view - FullCalendar

729 Views Asked by At

How to add custom text in a fullcalendar event day view. I have this requirement to add a tagging in the event. Please refer to image attached.

FullCalendar reference

1

There are 1 best solutions below

0
ADyson On

If you want to add something to an event, look at thee eventRender - you can modify the HTML of the event an way you want, and you have access to all the event's properties as a data source.

e.g.

eventRender: function(info)
{
  info.el.innerHTML += info.event.extendedProps.description;
}

N.B. This specific example relies on you having an extra property called "description" in the event data you pass to the calendar - demo: https://codepen.io/ADyson82/pen/qBKvqom . But of course you can also simply manipulate the existing content, or display something from another standard property too. The world's your oyster.