FullCalendar - 全天的活动时间太短 [英] FullCalendar - Event spanning all day are one day too short

查看:541
本文介绍了FullCalendar - 全天的活动时间太短的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  {
id:31,
title:'Test',
start:'2014-12-22',
end:'2014-12-23',
allDay:true
}

我期望在日历中找到一个跨越整整两天的事件,但事件仅在 2014-12-22 插槽,不在 2014-12-23 中。 nextDayThreshold参数设置为 00:00:00 ,但根据文档,allDay设置为true时应忽略它。我确信allDay被正确解释,因为在议程视图中,该事件出现在全天行。



如何设置fullcalendar以显示此类事件我相信这是一个有意识的设计决定,因为所有的结束日期都被认为是排他性的,基于像这个,也就是说尽管是一整天的事件,但您的结束日期不被视为包含(包括)标记的日期。例如如果您的开始日期 2015-03-01 00:00:00 且结束日期 2015-03-02 00:00: 00 只有一天。



这似乎与版本2升级到使用moment.js 。因此,看起来您需要将23:59:59添加到结束日期,或者找到一种指定结束日期的不同方式,例如,作为两天的时间添加到开始日期?


I'm passing to fullcalendar an event like this one:

{
     id: 31,
     title: 'Test',
     start: '2014-12-22',
     end: '2014-12-23',
     allDay: true
}

I expected to find in the calendar an event that spans two whole days, but the event is only in the 2014-12-22 slot, not in the 2014-12-23 one. The nextDayThreshold parameter is set to 00:00:00, but according to the documentation it should be ignored when allDay is set to true. I'm sure that allDay is correctly interpreted because in the agenda view the event appears in the all-day row.

How can I set fullcalendar to display such an event in both days?

解决方案

I believe this a conscious design decision, in that all end dates are to be regarded as exclusive, based on discussions like this and this, i.e. so despite being an all day event, your end date is not regarded as included (inclusive) of the dates tagged. e.g. If you have a start date of 2015-03-01 00:00:00 and an end date of 2015-03-02 00:00:00 the span is only one day.

This seems to coincide with the version 2 upgrade to using moment.js. So it would appear you will either need to add '23:59:59' to your end date, or to find a a different way of specifying the end date, e.g. as a duration of two days added to the start date?

这篇关于FullCalendar - 全天的活动时间太短的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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