I am trying to get the \'dayClick\' function to work on FullCalendar, but when I press on any empty day, nothing happens. I have searched all over SO and cannot find any sol
Only relevant for FullCalender v2:
I found that on my calendar the div
with the class fc-bg
was hidden by using display:none;
. It turns out that this is what the dayClick
event is attached to, and since it was hidden, I could not click on it.
The reason why the fc-bg
class had been hidden was because of a print CSS that I included on the page. It turns out that it is super important that this stylesheet has media="print"
on the link, otherwise it will always be used.
When including the FullCalendar CSS files on your page, ensure that the links are like this:
<link href="/css/vendor/fullcalendar.min.css" rel="stylesheet" />
<link href="/css/vendor/fullcalendar.print.css" media="print" rel="stylesheet" />
My problem was close to: https://stackoverflow.com/a/39342912/6364246
dayClick only worked when I clicked on the screen visible without scrolling. I changed html css{overflow-y:scrolling} to {overflow-y:visible} and worked