Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display only 2 Weeks in Month View [FullCalendar]

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

like image 932
Cons7an7ine Avatar asked Dec 18 '22 03:12

Cons7an7ine


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 }
        }
    }
});
like image 103
smcd Avatar answered Jan 19 '23 04:01

smcd