默认视图设置为agendaWeek。如果我在晚上11:59加载完整日历,则在我刷新浏览器之前,今天的时段不会在12:00AM之后自动更新。
这就是我修复它的方法:
每5分钟调用一次函数(或适合您要求的任何间隔)
$(function() {
var tInterval = 5*60*1000;
timelineInterval = window.setInterval(updateFcToday, tInterval); // Update timeline after every 5 minutes
});
在包含日历的页面上添加这样的功能:
function updateFcToday() {
var curTime = new Date();
if(curTime.getHours() == 0 && curTime.getMinutes() <= 5) // this five minutes is same interval that we are calling this function for. Both should be the same
{// the day has changed
var todayElem = $(".fc-today");
todayElem.removeClass("fc-today");
todayElem.removeClass("fc-state-highlight");
todayElem.next().addClass("fc-today");
todayElem.next().addClass("fc-state-highlight");
}
}