简体   繁体   English

fullcalendar事件开始时间

[英]fullcalendar event start time

I want to show events using the JQuery fullcalendar plugin (version 1.5.2). 我想使用JQuery fullcalendar插件(版本1.5.2)显示事件。 The JSON data provided to this plugin is: 提供给此插件的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}]

I've set allDay to true, but when the events are displayed they look like they start at around 6AM on 2011-10-10. 我已经将allDay设置为true,但是当事件显示时,它们看起来像是在2011-10-10上午6点左右开始。

在此输入图像描述

I've also tried using the UNIX timestamp date format instead, but it didn't make any difference. 我也尝试过使用UNIX时间戳日期格式,但它没有任何区别。 How can I make the events appear as though they last two whole days. 如何使事件看起来好像持续了整整两天。

My fullcalendar code is simply: 我的完整日历代码很简单:

    $(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 of someone using this plugin to display allDay events properly, but it's not clear what's different between their code/data and mine. 这是一个使用此插件正确显示allDay事件的示例 ,但不清楚他们的代码/数据与我的之间有什么不同。

You can reproduce this problem locally by downloading this archive , unzipping it, then opening calendar.htm 您可以通过下载此存档 ,解压缩然后打开calendar.htm在本地重现此问题

I figured out it is a problem with your CSS, namely main.css file. 我发现你的CSS是一个问题,即main.css文件。 The lines 406-413 create the unnecessary padding. 线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;
}

Comment them and the padding from the left (and right) will disappear. 注释它们和左侧(和右侧)的填充将消失。 Warning: These lines might be in use on other pages of your website, so you better edit them carefully. 警告:这些行可能正在您网站的其他页面上使用,因此您最好仔细编辑它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM