0

I am showing the month view in the Full Calendar. When i click a day in the month view it should display the Day/Agenda View for that particular day.

Below is the code - But it shows the present days agenda view instead the one clicked.

dayClick: function(date, allDay, jsEvent, view) {

      if (allDay) {
        // Clicked on the entire day
        $('#calendar')
        .fullCalendar('changeView', 'agendaDay'/* or 'basicDay' */)
        .fullCalendar('gotoDate', date.getFullYear(), date.getMonth(), date.getDate());
      }

    },

2 Answers 2

6

here is how i do that exact thing:

dayClick: function(date, jsEvent, view) {
  if(view.name == 'month' || view.name == 'basicWeek') {
    $('#calendar').fullCalendar('changeView', 'basicDay');
    $('#calendar').fullCalendar('gotoDate', date);      
  }
}

code edit

1
  • changing the order gotoDate and ChangeView got it working for me on my code
    – Harsha M V
    Jan 17, 2015 at 3:30
4

For the version 4 is like this:

dateClick: function(info) {
    if(info.view.type=="dayGridMonth"){
        this.changeView("timeGridDay",info.dateStr);
    }
  }

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.