Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullcalendar - jump to agendaDay from month view when date is picked

Tags:

fullcalendar

I'm having trouble getting this functionality to work. I would like for the user to be able to jump to the agendaDay view from the month view after selecting a date. Can anyone suggest a way to achieve that functionality?

like image 603
Doug H. Avatar asked Aug 16 '11 00:08

Doug H.


2 Answers

Use the dayClick event, along with changeView and gotoDate

dayClick: function(date, allDay, jsEvent, view) {
  if(view.name != 'month')
    return;

  $('#calendar').fullCalendar('changeView', 'agendaDay')
                .fullCalendar('gotoDate', date);
},
like image 194
Brandon Avatar answered Oct 03 '22 08:10

Brandon


Just the updated answer for the new versions 2.x.x.

You have to call the methods this way:

$('#calendar').fullCalendar('changeView', 'agendaDay');
$('#calendar').fullCalendar('gotoDate', date);

because chaining for the method calls is not implemented (fullCalendar() call to method returns method response instead of JQuery object).

like image 20
Jarzyn Avatar answered Oct 03 '22 08:10

Jarzyn