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());
}
},
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());
}
},
Share
Improve this question
asked Jan 15, 2015 at 10:44
Harsha M VHarsha M V
55k130 gold badges363 silver badges536 bronze badges
2 Answers
Reset to default 6here 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
For the version 4 is like this:
dateClick: function(info) {
if(info.view.type=="dayGridMonth"){
this.changeView("timeGridDay",info.dateStr);
}
}