Displaying events - always allDay

会有一股神秘感。 提交于 2019-12-10 20:53:51

问题


I'm displaying results from my db via JSON onto the calendar

A small example is as follows

"start":"2013-11-12 14:00:00","end":"2013-11-12 15:00:00" (ignore the start/end of the JSON)

This works fine and displays the event on the correct day.

When I switch to agendaWeek it displays the event as allDay

I know I can set a flag for allDay as being false, but these details are coming straight from the db.

In the eventRender function I have the following:

$.fullCalendar.formatDate(event.start, 'dd-MM-yyyy HH:mm');
$.fullCalendar.formatDate(event.end, 'dd-MM-yyyy HH:mm');

This doesn't seem to affect the rendering. All of the events are still allDay

Any ideas?


回答1:


I think you must set the allDay attribute to false, that it's usually true as configuration default; from the docs:

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.

Code example:

var event = [{"title":"Timed event","start":"2013-11-12 14:00:00","end":"2013-11-12 15:00:00","allDay":false}];

Demo: http://jsfiddle.net/Xc8yD/



来源:https://stackoverflow.com/questions/20265649/displaying-events-always-allday

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!