Ramee
Ramee

Reputation: 65

How to get Year View in full calendar control

I am using fullcalendar control v1.6.4. Is there any way to get year view with fullcalendar control? I tried something like this but the year option is not coming.

$('#calendar').fullCalendar({
    header: {            
        left: 'prev,next today',
        center: 'title',
        right: 'year,month,agendaWeek,agendaDay'
    },

Thanks

Upvotes: 1

Views: 5313

Answers (1)

Mario Levrero
Mario Levrero

Reputation: 3367

You can not have a Year view because it doesn´t exist, as you can see in the Available views.

But if you want to allow the user to move to another year without clicking every month, as you suggest in your comments, you can attach to the form a datepicker, and get the result of the user selection.

You could use, for example, jqueryUi datePicker and detect when its changed using onSelect event. Then, you just need to change the date of your fullCalendar.

So you could have something like:

$(".date").datepicker({
  onSelect: function(dateText) {
       var selectedDate = this.value;
       $('#calendar').fullCalendar( 'gotoDate', selectedDate );
  }
});

Upvotes: 2

Related Questions