Display only 2 Weeks in Month View [FullCalendar]

Viewed 4080

How to show only 2 weeks or 15 days in a month view?

I tried the following:

$('#calendar').fullCalendar({
defaultView: 'month',
duration: { weeks: 2 } // or days: 15
});

but it didn't work. I read the documentation but it only shows customization of basic/agenda view.

Edit: adds picture of desire calendar

picture

1 Answers

You can use week view and aside from being a bit stretched looking may give what you want

https://jsfiddle.net/x8b7a8yj/

Fiddle specs: jQuery 3.2.1, momentjs 2.18.1, fullcalendar 3.5.1

$('#calendar').fullCalendar({
    defaultView: 'week',
    views: {
        week: {
            type: 'basic', /* 'basicWeek' ?? */
            duration: { weeks: 2 }
        }
    }
});
Related