在月视图中剪切事件的结束时间

时间:2015-04-13 12:34:30

标签: javascript jquery fullcalendar

我在更新版本后更新了fullCalendar的问题。 如果事件的结束时间早于上午9点,则事件的最后一天将被删除。

我的fullCalendar初始化:

$('#calendar').fullCalendar({
   header: {
       left: 'prev,next today',
       center: 'title',
       right: ''
   },
    editable: false,
    events: [
        {
            "title":"normal 3 days event",
            "start":"2015-04-13T08:00:00",
            "end":"2015-04-15T09:00:00"},
        {
            "title":"cutted 3 days event",
            "start":"2015-04-19T01:00:00",
            "end":"2015-04-21T08:00:00"}],
    timeFormat: ' '//for hiding of event's start time
});

另外,我向fiddle提供了2个事件。首先是晚于8AM的结束时间并正常工作,第二次被削减。

我觉得麻烦在于时区并尝试添加时区:" UTC",但它不会帮助我。

1 个答案:

答案 0 :(得分:4)

这与nextDayThreshold有关,而与时区无关。 默认情况下,如果未显示09:00之前的多日事件。如果要显示每个事件,只需将其设置为00:00:00。

$('#calendar').fullCalendar({
   header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month, agendaWeek' //You can check it adding new views
            },
    editable: false,
    nextDayThreshold : "00:00:00", //Add this line
    events: [{"title":"New Franchisee Training","location":"Hastings, MN","start":"2015-05-11T08:00:00","end":"2015-05-15T11:00:00","color":""},{"title":"Vitals Training","location":"PL","start":"2015-05-19T01:00:00","end":"2015-05-21T05:00:00","color":""}],
                timeFormat: ' ',
            timezone: 'UTC'
});

我叉你的fiddle。我还在不同视图中添加了按钮,因此您可以轻松查看。

相关问题