Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FullCalendar change view from month to day

In my FullCalendar application, more specifically on the month view visualization, I have a link that appears whenever 3 or more events are added to the same day, then I want to make that link lead to the day view mode for that particular day.

$(".events-view-more a").click(function () {
    alert("clicou");
});

The parent (parent of .events-view-more a) td element contains a data attribute with the date value containing something like "2013-11-29".

How can I use this to change the visualization mode to day view of that day?

like image 488
rodrigoalvesvieira Avatar asked Dec 17 '25 09:12

rodrigoalvesvieira


2 Answers

Something like this will take you from the Month view to the Day view if you click anywhere on the cell in the Month view:

$('#calendar').fullCalendar({

   //other parameters here          

   dayClick: function(date, jsEvent, view) {

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

   }

});

Hopefully this is useful for others, I know it is an old post.

like image 80
Jeff K Avatar answered Dec 20 '25 01:12

Jeff K


$(".events-view-more a").click(function () {
    var date=new Date($(this).parents('td').attr('date'));
$('#fullCalendar').fullCalendar('gotoDate', date.getFullYear(), date.getMonth(), date.getDate());
});
like image 25
Mahesh Reddy Avatar answered Dec 19 '25 23:12

Mahesh Reddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!