Fullcalendar事件高度为零

时间:2014-03-10 16:19:41

标签: javascript fullcalendar

我正在使用Fullcalendar,之前它工作得很好,但今天我重复使用它,它有一个问题,所有事件都有height = 0

以下是我的代码:

$('#calendar').fullCalendar({
        header:{
            left:'title',
            center:'',
            right:'prev,next,today agendaWeek,agendaDay'
        },
        buttonText:{
            prev:'<span>&lsaquo;</span>',
            next:'<span>&rsaquo;</span>'
        },
        defaultView:'agendaWeek',
        aspectRatio:3,
        selectable:true,
        selectHelper:true,
        theme:false,
        editable:false,
        allDaySlot:false,
        droppable:false,
        slotMinutes: <?php echo Yii::app()->params['app_rust_appointment_duration'] ?>,
        events:{
            url:'<?php echo $this->createUrl('getCustomer') ?>',
            success: function (data) {
                console.log(data);
            }
        }
    });

Ajax结果:

[{ "id": "1", "title": "Khanh Tran", "start": "2014-03-03 08:00:00", "end": "2014-03-03 08:00:45", "allDay": false },{ "id": "2", "title": "Khanh Tran", "start": "2014-03-06 08:00:00", "end": "2014-03-06 08:00:45", "allDay": false },{ "id": "3", "title": "Khanh Ngam", "start": "2014-03-06 19:15:00", "end": "2014-03-06 19:15:45", "allDay": false }]

我得到的问题就像这张照片:

enter image description here

请帮帮我

由于

1 个答案:

答案 0 :(得分:3)

您的活动似乎长达45秒。如果您的活动真的是45秒,您可以将fc-event更新为最小高度。

fullcalendar.css中的示例:

.fc-event {
border: 1px solid #3a87ad;
background-color: #3a87ad;
color: #fff;
font-size: .85em;
cursor: default;
min-height: 15px; // additional styling here
}