全日历时间轴视图的最后一列始终较宽

Ste*_*fan 7 javascript fullcalendar fullcalendar-scheduler

我已经为全日历调度程序的时间线视图(timelineCustomMonth,timelineCustomWeek,timelineCustomDay)创建了自定义视图。

但是,无论分辨率如何,最后一列始终比前一列宽。

我可以说这与另一个CSS文件没有问题,因为我排除了所有CSS文件,除了用于全日历的CSS文件,问题是相同的。

Fullcalendar v3.0.1 Fullcalendar-Scheduler v1.4.0

这是我的javascript fullcalendar初始化:

$("#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'
                ]
            }
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

这是发生问题的不同视图的两个屏幕截图:

timelineCustomMonth

时间轴CustomDay

提前致谢。

Did*_*zis 0

就我而言,将slotWidth设置为相对值 (5%) 解决了最后一列拉伸的问题。

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

        slotWidth: "5%",

        resourceAreaWidth: '200px',
        contentHeight: 'auto',
        eventOverlap: false,
        selectOverlap: false
        ...
});
Run Code Online (Sandbox Code Playgroud)