【发布时间】:2017-11-09 21:45:26
【问题描述】:
我正在尝试为可选属性设置规则。规则应该是这样的:
selectable attribute is true for future weeks, otherwise false
但是,我找不到如何在日历选项中检查日期。我尝试了一些方法,但 javascript 不接受这些方法。这是我目前的选择。有什么帮助吗?
$(document).ready(function () {
$('#calendar').fullCalendar({
//some options
//some options
selectable: true,
selectHelper: true,
select: function (start, end) {
var title = loadRequired("ff8081815c776701015c7788151d06b4",
"activity",
"@Session["token"].ToString()");
var eventData;
if (title) {
eventData = {
title: title,
start: start,
end: end
};
$('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
}
$('#calendar').fullCalendar('unselect');
},
});
});
【问题讨论】:
-
有什么问题?在“选择”回调中,检查开始/结束日期。如果它们在您希望允许的日期之前,则不要继续处理代码,只需返回 false。
标签: javascript jquery calendar fullcalendar asp.net-mvc-5