How to get selected month in jQuery full calendar?

With last version (2018) need to use this code!

jQuery("#your_selector").fullCalendar('getDate').month()

Maybe I don't fully understand your quesiton, but it sounds like you just need to know the current month on screen?

FullCalendar has a "getDate" method.

function getMonth(){
  var date = $("#calendar").fullCalendar('getDate');
  var month_int = date.getMonth();
  //you now have the visible month as an integer from 0-11
}

Sorry if this isn't what you were asking.


The function "getView" which might be useful to you:

  • http://arshaw.com/fullcalendar/docs/views/View_Object/

To get the first day of calendar month:

$(cal).fullCalendar('getView').start

To get the last day of calendar month:

$(cal).fullCalendar('getView').end

To get the first visible day of calendar: (the last few days of previous month)

$(cal).fullCalendar('getView').visStart

To get the last visible day of calendar: (the first few days of next month)

$(cal).fullCalendar('getView').visEnd