Search code examples
javascriptfullcalendarfullcalendar-schedulerfullcalendar-3

how to customise weekend dates with differnt dates and with differnts hours in full calendar


I want to show calendar in month view with an row wise date eg: today date 2018-sep-05,I would to show in calendar.

2018-9-05,
2018-9-12,
2018-9-19
2018-9-26,

As I have done in week view jsfidddle in this is fine,
I want to do same as weekday view jsfidddle2, but, here comes my problem with dow, here dow is 3 means Wednesday, I want to show 5,12,19,26 dates with same dow and in different timings.
All I want to below timing should fit in calendar

sep05 07am - 09pm, 
sep12 08am - 14pm,
sep19 10am - 13pm,


Is their any way to make it or any trick way.

     var hiddenDaysObj = [0, 1, 2, 3, 4, 5, 6];
        hiddenDaysObj.splice(selDate.getDay(), 1);
  const calObj = {
          defaultView: 'settimana',
          defaultDate: this.cldDate,
          editable: true,
          selectable: true,
          eventLimit: true,
          allDaySlot: false,
          minTime: '07:00',
          maxTime: '22:00',
          slotDuration: '00:10:00',
          slotLabelInterval: '00:15:00',
          weekends: true,
          header: {
            left: '',
            center: '',
            right: '',
          },
          slotLabelFormat: [
            'h(:mm) a'
          ],
          viewRender: function (view, element) {
            const s = '<div class="appnt-pro-name"><h6>TIME</h6> </div>';
            element.find('.fc-axis:eq(1)').html(s);
          },

          views: {
            settimana: {
              type: 'agendaWeek',
              duration: {
                months: 1
              },
              title: 'agendaWeek',
              groupByResource: true,
              columnFormat: 'ddd M/D',
            },
          },
          resources: resources,
          events: events,
          select: select,
       hiddenDays: hiddenDaysObj,
          schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source'

Solution

  • Finally I have done with this https://fullcalendar.io/docs/background-events I have pushed the date and time with in events. I have got according to my scenario and thanks @ADyson
    here is the example finalresult jsfiddle

    events.push({id:1,
    color:"gray",
    start:"2018-09-05T10:00",
    end:"2018-09-05T19:00",
    rendering:"inverse-background",
    },{
    id:1,
    color:"gray",
    start:"2018-09-12T08:00",
    end:"2018-09-12T13:00",
    rendering:"inverse-background",
    });