显示事件 - 始终allDay [英] Displaying events - always allDay

查看:85
本文介绍了显示事件 - 始终allDay的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



一个小例子如下



< 开始:2013-11-12 14:00:00,结束:2013-11-12 15:00:00(忽略JSON的开始/结束)



这可以正常工作并在正确的日期显示事件。



当我切换到 agendaweek 时,它将事件显示为 allDay



我知道我可以为 allDay 设置一个标记为false,但这些细节直接来自db。



eventRender 函数中,我有以下内容:

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

这似乎不影响渲染。所有的事件仍然是 allDay



有什么想法?

解决方案

我认为你必须设置 allDay 属性为false,通常它是默认的配置。从文档:


true或false。可选。



一个事件是否发生在特定的时间点。此属性
影响是否显示事件的时间。此外,在议程视图中,
决定它是否显示在全天部分。



不要在真/假附加引号。这个值不是
字符串!

当为事件或事件源指定事件对象时,省略
这个属性将使它继承自allDayDefault,它是
通常是真的。


代码示例:

  var event = [{title:Timed event,start:2013-11-12 14:00:00,end:2013-11-12 15 :00:00\" , 阿迪:假}]; 

演示: http://jsfiddle.net/Xc8yD/


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?

解决方案

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/

这篇关于显示事件 - 始终allDay的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆