In the FullCalendar dayClick event, can I get the events that already exist in clicked date?
http://arshaw.com/fullcalendar/docs/mouse/dayClick/
Let me expla
Exested answers didn't work for me so there is working code:
dayClick: function (date, jsEvent, view) {
var count = 0;
date = date.toDate();
var startDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var endDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
$('#calendar').fullCalendar('clientEvents', function (event) {
if (event.start.toDate() >= startDate && event.start.toDate() <= endDate
|| event.end.toDate() >= startDate && event.end.toDate() <= endDate) {
count++;
}
});
//count - number of events on this day
}