fullcalendar事件开始时间

时间:2011-10-09 23:52:00

标签: javascript jquery fullcalendar

我想使用JQuery fullcalendar插件(版本1.5.2)显示事件。提供给此插件的JSON数据是:

 [{"start":"2011-10-10","end":"2011-10-11","title":"Electric Picnic","allDay":true},
  {"start":"2011-10-10","end":"2011-10-11","title":"Oxeygen","allDay":true}]

我已将allDay设置为true,但是当显示事件时,它们看起来就像是在2011-10-10凌晨6点左右开始的。

enter image description here

我也尝试过使用UNIX时间戳日期格式,但它没有任何区别。如何使事件看起来好像持续了整整两天。

我的全日历代码很简单:

    $(document).ready(function() {
        $('#calendar').fullCalendar({
            events: [{"start":"2011-10-10","end":"2011-10-11","title":"Electric Picnic","allDay":true}, {"start":"2011-10-10","end":"2011-10-11","title":"Oxeygen","allDay":true}],

            // Make the first day of each week a monday
            firstDay: 1,
            weekMode: 'variable',
            header: {
                left:   '',
                center: 'title',
                right:  'today prev,next'
            }
        });
    });

Here's an example有人使用此插件正确显示allDay事件,但不清楚他们的代码/数据与我的之间有什么不同。

您可以通过下载this archive,解压缩然后打开calendar.htm

在本地重现此问题

1 个答案:

答案 0 :(得分:1)

我发现你的CSS存在问题,即main.css文件。 406-413行创建了不必要的填充。

tr>td:first-child, tr>th:first-child {
    padding-left: 1.25em;
}

tr>td:last-child, tr>th:last-child {
    padding-right: 1.25em;
}

注释它们,左边(和右边)的填充将消失。 警告:这些行可能正在您网站的其他网页上使用,因此您最好仔细编辑它们。