在月视图中将天数限制为单一的全天事件

是否有可能将月份限制在单月全天事件? 理想情况下,这将处理单独的日期选择以及日期范围。


当然,有更好的方法可以做到这一点,但这是我现在能够提出的。 我希望能够在不必循环所有事件的情况下完成此任务。

select: function (newEvent_start, newEvent_end, allDay) {
                var okToAdd = true;
                $('#calendar').fullCalendar('clientEvents', function (event) {
                    if ( (newEvent_start >= event.start && newEvent_end <= event.end) || // between
                         (newEvent_start <= event.start && newEvent_end >= event.start) || // starts before, ends during
                         (newEvent_start >= event.start && newEvent_start <= event.end && newEvent_end >= event.end)  // starts during, ends after
                       )
                        okToAdd = false;
                });

                if (okToAdd) {
                    calendar.fullCalendar('renderEvent',
                    {
                        title: 'Title goes here',
                        start: newEvent_start,
                        end: newEvent_end,
                        allDay: allDay
                    },
                    true 
                );
                }
                calendar.fullCalendar('unselect');
            }
链接地址: http://www.djcxy.com/p/14255.html

上一篇: Limit days to a single all day event in month view

下一篇: Authenticate by source address with CouchDB