Search code examples
javascriptjqueryfullcalendarfullcalendar-scheduler

Show more than 1 day in Fullcalendar Day View


I am trying to use the Full Calendar component to show 3 days in agenda Day view or eventually using the vertical resource view.

I tried using the example custom view but no luck.

Is it possible to show 3 days, one below another in the day view ?

I am using this constructor, but I don't want the days to be next to each other, but underneath each other.

$('#calendar').fullCalendar({
      defaultView: 'agendaDay',
      defaultDate: '2017-12-07',
      editable: true,
      selectable: true,
      eventLimit: true, // allow "more" link when too many events
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'agendaDay,agendaTwoDay,agendaWeek,month'
      },
      views: {
        agendaTwoDay: {
          type: 'agenda',
          duration: { days: 3 },

          // views that are more than a day will NOT do this behavior by default
          // so, we need to explicitly enable it
          //groupByResource: true

          //// uncomment this line to group by day FIRST with resources underneath
          groupByDate: true
        }
      }


Solution

  • In order to show multiple days in Agenda View ( Day ) just add - and + how many hours you want ... For example -24 H for a day ahead and +24 H for a day after your selected day. Something like this:

      views: {
    
        firstView: {
          type: 'agendaDay',
          minTime: '-12:00:00',
        maxTime: '36:00:00',
        slotDuration: '00:30:00',
                },
    
      }