往事,我使用full calendarAngular 2;如何隐藏/禁用fullcalendar
this.calendarOptions = {
height: '1000',
fixedWeekCount: false,
header:
{
left: 'prev,next,today',
center: 'title',
right: 'month,listYear',
},
defaultDate: new Date(),
editable: true,
timeFormat: 'hh:mm A',
eventLimit: true,
events: (start, end, title, callback) => {
this.calenderservice.getExamCandidateById(this.value)
.subscribe(response => {
callback(response),
this.modalData = response.Items
this.myCalendar.fullCalendar('renderEvents', this.modalData)
console.log(this.modalData);
console.log(response);
});
},
响应
Items:{
ExamName:null
ExamSiteId:334
Id:85
LastUpdateDateTime:"0001-01-01T00:00:00"
PostalCode:"33172"
PptSeats:null
SeatCount:0
SiteName:"UF"
State:"FL"
end:"2017-09-27T10:30:00"
isCbt:"1"
isPpt:null
start:"2017-09-27T10:30:00"
title:"7 available"
}
从上面的代码我得到的所有启动和响应结束日期,并显示在事件日历
我想隐藏过去的事件,我如何隐藏包含当前日期在fullcalendar中的过去开始和结束日期的事件。
请帮帮我。
也许不会从服务器首先返回它们?如果需要,你可以发送一个标志变量给服务器,以表明你不希望它在当前日期之前给你提供事件。目前,你甚至不会发送fullCalendar给你的开始/结束日期,所以我猜你甚至在fullCalendar不显示它们时也毫无意义地返回你的事件。 – ADyson