如何修改列表视图以形成从头到尾的视图(FullCalendar)

时间:2019-01-14 21:49:35

标签: fullcalendar

我想显示一个具有分组日期的列表(即:BeginDate-EndDate)。在这里,调用fullCalendar的javascript。

    var calLink = $('#calendar-link');
    calLink.fullCalendar({
        locale: 'en-US',
        height: 'auto',
        header: false,
        lazyFetching: false,
        themeSystem: 'bootstrap4',
        displayEventTime: false,
        displayEventEnd: true,
        nextDayThreshold: '01:00:00',
        defaultView: 'listTwoYears',
        eventSources: [
            {
                url: calLink.data('url'),
                type: 'GET',
                data: {},
                error: function () {
                },
                success: function (data, textStatus, jqXHR)
                {
                    console.log(textStatus);
                    console.log(data);
                }
            }
        ],
        views: {
            listTwoYears: {
                eventOrder: 'title',
                type: 'list',
                duration: { days: 730 },
                buttonText: 'list'
            }
        }
    });

这是预期的结果:

2019-01-18 to 2019-01-20
Event 1

2019-01-19 to 2019-01-20
Event 2

2019-01-20
Event 3

Require display

但这就是我现在所拥有的(正常的列表行为):

2019-01-18
Event 1

2019-01-19
Event 1
Event 2

2019-01-20
Event 1
Event 2
Event 3

Current display

使用此json创建列表:

[
    {
        "title":"Event 1",
        "description":"Desc. Event 1",
        "start":"2019-01-18 12:00:00",
        "end":"2019-01-20 18:00:00",
        "allDay":false,
        "editable":false,
        "startEditable":false,
        "durationEditable":false,
        "overlap":false
    },
    {
        "title":"Event 2",
        "description":"Desc. Event 2",
        "start":"2019-01-19 12:00:00",
        "end":"2019-01-20 18:00:00",
        "allDay":false,
        "editable":false,
        "startEditable":false,
        "durationEditable":false,
        "overlap":false
    },
    {
        "title":"Event 3",
        "description":"Desc. Event 3",
        "start":"2019-01-20 12:00:00",
        "end":"2019-01-20 18:00:00",
        "allDay":false,
        "editable":false,
        "startEditable":false,
        "durationEditable":false,
        "overlap":false
    }

]

我尝试了很多方法来查找文档并搜索网络。

0 个答案:

没有答案