Hello, all right?
First of all the 'dayClick' event is triggered when a calendar date is clicked and not a calendar event.
Another thing I realized is that the method parameters are quite different from the documentation parameters. Note: https://fullcalendar.io/docs/mouse/dayClick/
If your problem is an event use the 'eventClick' method.
Follow the documentation link https://fullcalendar.io/docs/mouse/eventClick/
Here’s an example of how you can do using both the Shot Event by clicking on a calendar day and the Shot Event by clicking on a calendar event.
$('#calendar-container').fullCalendar({
header: {
left: 'prev, next today',
center: 'title',
right: 'month, basicWeek, basicDay'
},
locale: 'pt-br',
defaultDate: '2016-12-19',
navLinks: true,
editable: false,
eventLimit: true,
events: events,
dayClick: function(date, jsEvent, view){
console.log("Clicou no dia: " + date.format());
},
eventClick: function(calEvent, jsEvent, view){
console.log("Clicou no evento: " + calEvent.title);
// Marco o evento clicado
$(this).css('border-color', 'red');
if(calEvent.url){
// Ativar um modal aqui
// Cancelo o evento
return false;
}
}
});
Welcome to the stackoverlow community. While this link may answer the question, it is best to include the essential parts of the answer here and provide the link for reference. For example, how to implement this.
– Marco Giovanni
I improved my answer.
– Fernando Nunes
Now yes good answer, +1
– Marco Giovanni