我想隐藏当前月份 View 中出现的上个月和下个月日期的单元格。 我尝试添加 css 但不适合我:
<style>
.hiddenEvent{display: none;}
.fc-other-month .fc-day-number { display:none;}
td.fc-other-month .fc-day-number {
visibility: hidden;
}
</style>
我想隐藏单元格,以便用户无法通过单击下个月的日期来创建事件。 谢谢。
最佳答案
从版本 3.3.0 开始,您现在可以使用 showNonCurrentDates: false 。
$('#calendar_1').fullCalendar({
header: {
left: '',
center: 'title',
right: ''
},
defaultView: 'month',
editable: true,
allDaySlot: true,
selectable: true,
selectHelper: true,
selectOverlap: false,
fixedWeekCount: false,
showNonCurrentDates: false,
select: function (start, end) {
var title = "Available";
var evid = SaveEvent(start, end, '1');
$('#calendar_1').fullCalendar('unselect');
},
eventClick: function (calEvent, jsEvent, view) {
var ev_id = calEvent.ID;
var st_dt = calEvent.start;
var ed_dt = calEvent.end;
infoEventShow('1', ev_id, st_dt, ed_dt);
},
slotMinutes: 15,
events: '/Aircrew/GetEvents/',
eventColor: '#339900'
});
引用 https://fullcalendar.io/docs/display/showNonCurrentDates/
关于jquery - 如何从全日历的当前月 View 中隐藏上个月和下个月的单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29454104/