JS FullCalendar中的事件提前一天结束

时间:2019-05-08 06:34:58

标签: javascript fullcalendar fullcalendar-4

我在网站上使用FullCalendar插件。

一天以上的“ allDay”事件都提前一天结束。

结束时间为00:00:00的多日活动也提前一天结束,无论nextDayThreshold是否设置为“ 00:00:00”(默认设置)。

有人经历过这种情况并提出了解决方案(不涉及为每个事件手动添加一天)吗?

这是我的MVC视图生成的一些示例代码...

addEvents = [];

addEvents.push({
    title: "Finishes one day early",
    url: "http://localhost:11634/events/115",
    allDay: true,
    start: '2019-11-08',
    end: '2019-11-10'});

addEvents.push({
    title: "Also finishes one day early",
    url: "http://localhost:11634/events/116",
    allDay: true,
    start: '2019-11-08T00:00:00',
    end: '2019-11-10T01:00:00'});

addEvents.push({
    title: "Also finishes one day early",
    url: "http://localhost:11634/events/116",
    start: '2019-11-08T00:00:00',
    end: '2019-11-10T00:00:00'});       

addEvents.push({
    title: "Works ok",
    url: "http://localhost:11634/events/117",
    start: '2019-11-08T00:00:00',
    end: '2019-11-10T01:00:00'});

addEvents.push({
    title: "Also works ok",
    url: "http://localhost:11634/events/141",
    start: '2019-05-19T09:00:00',
    end: '2019-05-19T13:00:00'});   

addEvents.push({
    title: "Also works ok",
    url: "http://localhost:11634/events/137",
    start: '2019-11-02',
    end: '2019-11-02'});        

document.addEventListener('DOMContentLoaded', function () {
    var calendarEl = document.getElementById('calendar');
    var calendar = new FullCalendar.Calendar(calendarEl, {
        plugins: ['dayGrid'],
        events: addEvents
    });
    calendar.render();
});

0 个答案:

没有答案