The last column of the full calendar is always wide.

I created custom views to represent the fullcalendar scheduler timeline (timelineCustomMonth, timelineCustomWeek, timelineCustomDay).

However, the last column is always wider than the previous ones, regardless of resolution.

I can say that this is not a problem with another CSS file, because I excluded all CSS files except one for fullcalendar, and the problem was the same.

Fullcalendar v3.0.1 Fullcalendar-Scheduler v1.4.0

This is my full javascript initialization:

$("#calendar").each(function () {

    var calendar = $(this);

    calendar.fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right:       'timelineCustomMonth,timelineCustomWeek,timelineCustomDay,listMonth'
        },
        firstDay: 1,
        eventLimit: true,
        schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
        resources: {
            url: '/machines',
            dataType: 'json'
        },
        resourceAreaWidth: "15%",
        events: {
            url: '/events',
            dataType: 'json'
        },
        views: {
            timelineCustomMonth: {
                type: 'timeline',
                duration: {month: 1},
                slotWidth: 5,
                slotDuration: {days: 1},
                slotLabelFormat: [
                    'D',
                    'dd'
                ]
            },
            timelineCustomWeek: {
                type: 'timeline',
                duration: {days: 7},
                slotWidth: 5,
                slotDuration: {hours: 4},
                slotLabelInterval: {hours: 4},
                slotLabelFormat: [
                    'D',
                    'H'
                ]
             },
            timelineCustomDay: {
                type: 'timeline',
                duration: {days: 1},
                slotWidth: 5,
                slotDuration: {minutes: 30},
                slotLabelInterval: {hours: 1},
                slotLabelFormat: [
                    'H'
                ]
            }
        }
    });
});

These are two screenshots of different types where problems arise:

timelineCustomMonth

timelineCustomDay

Thanks in advance.

+6
source share
1 answer

slotWidth (5%) .

$('#schedule').fullCalendar({
        schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
        now: new Date(),

        slotWidth: "5%",

        resourceAreaWidth: '200px',
        contentHeight: 'auto',
        eventOverlap: false,
        selectOverlap: false
        ...
});
0

Source: https://habr.com/ru/post/1660047/


All Articles