我在fullcalendar(v2.2.3)中使用allDay选项时出现问题。当我使用视图“月”时,我可以看到我所有的allDay事件。但是当我切换到agendaWeek视图时,它们就丢失了。
我的日历周从星期二开始(firstDay:2)。隐藏星期日和星期一(hiddenDays:[0,1])。当一个事件在星期二开始并且allDay设置为true时,在AgendaWeek视图中缺少该事件。
$("#calendar").fullCalendar(
header:
left: "month,agendaWeek,agendaDay"
center: 'title'
right: "today prev,next"
minTime: '07:00:00'
maxTime: '20:30:00'
defaultView: "agendaWeek"
timezone: 'Bern'
lang: 'de'
allDaySlot: true
firstDay: 3
hiddenDays: [0, 1]
weekNumbers: true
editable: false
slotDuration: '00:30:00'
snapDuration: '00:15:00'
slotEventOverlap: true
axisFormat: 'HH:mm'
selectable: true
selectHelper: true
events: (start, end, timezone, callback) ->
$.ajax
url: $('#calendar').data('url')
dataType: "json"
type: 'GET'
success: (data) ->
events = []
$.each data, (index, element) ->
events.push
id: element.id
title: element.title
start: element.start
end: element.end
color: '#' + element.color
allDay: element.allDay
callback events
我的json文件看起来像:
[{"id":100,"start":"2014-12-16T00:00:00.000+01:00","end":"2014-12-17T23:59:59.999+01:00","title":"Here is a title","color":"8884a2","allDay":true},{"id":101,"start":"2014-12-17T00:00:00.000+01:00","end":"2014-12-18T23:59:59.999+01:00","title":"Here is a title","color":"8884a2","allDay":true}]
所有其他事件(不是allDay事件)都在日历中正确列出。