0
デフォルトビューはアジェンダウィークに設定されています。午後11時59分にfullCalendarをロードすると、今日日スロットは、午前12時以降にブラウザをリフレッシュするまで自動的に更新されません。何かsetAsToday(date)と同じですか?
デフォルトビューはアジェンダウィークに設定されています。午後11時59分にfullCalendarをロードすると、今日日スロットは、午前12時以降にブラウザをリフレッシュするまで自動的に更新されません。何かsetAsToday(date)と同じですか?
これは私がそれを固定する方法である:
は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");
}
}