Fullcalendar month and current year

Asked

Viewed 508 times

1

Good evening to all, I need to know if there is a way to catch the month and the current year of FullCalendar, when we click on go or go back.

I couldn’t figure out which event fires when I click the forward and backward date buttons. The idea is to have these dates to do the research in a database and bring the events of the month being exposed on the screen of Fullcalendar, for example October 2017.

Is there another way to pass this data to the database search? I’m using an array with json for the setFullCalendarEvents = function(){}

1 answer

0


Good morning to you all! I want to share a solution that I found. I am using a template that has fullcalendar, so searching the documentation I found the following solution: I created 3 buttons: forward, backward, TODAY . The function that rescues the displayed date is:

var moment = $('#full-calendar').fullCalendar('getDate');
var dt = moment.format()

We have the following functions that play the role of moving forward, moving backwards and today:

$('#full-calendar').fullCalendar('prev');

$('#full-calendar').fullCalendar('today');

$('#full-calendar').fullCalendar('next');

They make the calendar go forward, go back and stay TODAY

I put these functions on their buttons:

$(".prev_data").click(function(){ 
    $('#full-calendar').fullCalendar('prev');
     var moment = $('#full-calendar').fullCalendar('getDate');
     alert(moment.format());
});

Okay, I was able to rescue the month/year that is being shown, when we go forward or go back the months in the calendar. Hug to all

Browser other questions tagged

You are not signed in. Login or sign up in order to post.