Mr.Kao
Mr.Kao

Reputation: 121

Fullcalendar add custom button to each day

How can I add custom buttons for each day in the fullCalendar?

enter image description here

Upvotes: 3

Views: 5980

Answers (1)

ADyson
ADyson

Reputation: 61904

For that your best solution is probably the dayRender callback which allows you to add extra HTML into the cell of each day before it is drawn on the calendar.

e.g. here's a super-simple example:

dayRender: function(info)
{
  info.el.innerHTML += "<button class='dayButton' data-date='" + info.date + "'>Click me</button>";
  info.el.style.padding = "20px 0 0 10px";
}

Live demo (including handled click event): https://codepen.io/ADyson82/pen/oNjExGx

Upvotes: 3

Related Questions