Deema Bataineh
Deema Bataineh

Reputation: 11

Some events not shown in month view- fullcalendar

I'm using fullcalendar v5 to draw events in month view. Events are sorted based on 'eventType'.

day max events is set to '3'.

The problem is some days in a month are not showing any events (or less than the dayMaxEvents, notice April 1 in screenshot), and shows +more.

I tried to figure out why this is happening, and I think it's because these events start on a previous day and this day drew '3' events only (based on sorting), leaving these extending till a certain day hidden.

calendar = new FullCalendar.Calendar(calendarEl, {
    plugins: [CustomViewPlugin],
    locale: 'en',
    contentHeight: 1000,
    views: {
        year: {
            type: 'year',
            dayMaxEventRows: 3,
            duration: { years: 1 },
            titleFormat: { year: 'numeric', month: 'long', day: '2-digit' }
        },

        week: {
            contentHeight: 650,
            dayMaxEvents: 10,
            dayHeaderFormat: { weekday: 'long' }
        },

        dayGridMonth: {
            contentHeight: 1270,
            dayMaxEvents: 3,
            dayHeaderFormat: { weekday: 'long' }
        },


    },

    initialView: 'year',
    timeZone: 'UTC',
    eventClick: function (info) {

        let event = info.event;
        showEventDetails(event.id);
        

    },
   
     events:
        [
            // Add your events here
            {
                title: 'Event 1',
                start: '2022-02-26',
                end: '2022-04-01',
                eventType: "Tier 1"
            },
            {
                title: 'Event 2',
                start: '2022-02-26',
                end: '2022-04-01',
                eventType: "Tier 1"
            },
            {
                title: 'Event 3',
                start: '2022-02-26',
                end: '2022-04-01',
                eventType: "Tier 1"
        },
        {
            title: 'Event 4',
            start: '2022-02-26',
            end: '2022-04-26',
            eventType: 'Tier 2'
        },
        {
            title: 'Event 5',
            start: '2022-03-26',
            end: '2022-04-26',
            eventType: 'Tier 2'
        },
        {
            title: 'Event 6',
            start: '2022-03-26',
            end: '2022-04-26',
            eventType: 'Tier 2'
            },
        {
            title: 'Event 7',
            start: '2022-03-26',
            end: '2022-04-26',
            eventType: 'Tier 2'
        },
        {
            title: 'Event 8',
            start: '2022-03-26',
            end: '2022-04-26',
            eventType: 'Tier 2'
        }
       
        ],

    eventOrder: "eventType",
    eventContent: function (info) {
        //event content here
    },

    fixedWeekCount: false,
    showNonCurrentDates: true

})

I want a way to always draw events up to dayMaxEvents even the day isn't the start day.

enter image description here

Upvotes: 0

Views: 646

Answers (1)

Deema Bataineh
Deema Bataineh

Reputation: 11

Updating fullcalendar from v5 to v6 solved this issue for me, now all days will have events up to dayMaxEvents.

Upvotes: 1

Related Questions