我正在通过 JSON 将数据库的结果显示到日历上
一个小例子如下
"start":"2013-11-12 14:00:00","end":"2013-11-12 15:00:00"
(忽略开始/结束JSON)
这工作正常并在正确的日期显示事件。
当我切换到 agendaWeek
时,它会将事件显示为 allDay
我知道我可以将 allDay
设置为 false 标志,但这些详细信息直接来自数据库。
在 eventRender
函数中,我有以下内容:
$.fullCalendar.formatDate(event.start, 'dd-MM-yyyy HH:mm');
$.fullCalendar.formatDate(event.end, 'dd-MM-yyyy HH:mm');
这似乎不会影响渲染。所有事件仍然是allDay
有什么想法吗?
最佳答案
我认为您必须将 allDay
属性设置为 false,因为配置默认值通常为 true;来自文档:
true or false. Optional.
Whether an event occurs at a specific time-of-day. This property affects whether an event's time is shown. Also, in the agenda views, determines if it is displayed in the "all-day" section.
Don't include quotes around your true/false. This value is not a string!
When specifying Event Objects for events or eventSources, omitting this property will make it inherit from allDayDefault, which is normally true.
代码示例:
var event = [{"title":"Timed event","start":"2013-11-12 14:00:00","end":"2013-11-12 15:00:00","allDay":false}];
关于jquery - 显示事件 - 始终全天,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20265649/