In jQuery fullcalendar we have previous and next buttons. How can we call some events on click of these buttons?
The best way is:
viewRender: function(view, element) {
var b = $('#calendar').fullCalendar('getDate');
alert(b.format('L'));
},
You couldsimply attach an event to the button:
$('.fc-button-prev span').click(function(){
alert('prev is clicked, do something');
});
$('.fc-button-next span').click(function(){
alert('nextis clicked, do something');
});
This worked for me:
$('body').on('click', 'button.fc-prev-button', function() {
//do something
});
$('body').on('click', 'button.fc-next-button', function() {
//do something
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With