javascript - 在月 View 中剪切事件的结束时间

标签 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 个事件。第一个的结束时间晚于上午 8 点并且工作正常,第二个已被剪切。

我认为问题出在时区上,并尝试添加时区:“UTC”,但这对我没有帮助。

最佳答案

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'
});

我已经 fork 了你的 fiddle 。我还在不同的 View 中添加了按钮,这样您就可以轻松检查。

关于javascript - 在月 View 中剪切事件的结束时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29605467/

相关文章:

javascript - 在 Raphael JS 中围绕你的论文绘制边框

javascript - 如何在 JavaScript 中获取非重复字符及其计数?

javascript - FullCalendar 事件后LimitClick

jquery - SlideToggle 高度为 "jumping"

jquery - 如何用新数据重绘jstree树?

javascript - yii2 Fullcalendar - 为什么 CalEvent 警报有效但更新 innerHtml 无效?

javascript - 添加新事件而不删除 FullCalendar 中的现有事件

javascript - 单击打开引导 Angular 范围日期选择器

c# - 如何将输出 HTML 标签 <b></b> 更改为 <strong></strong>?

javascript - 单击选择中的选项标签时将类添加到祖 parent