[英]Show days and events only of the current month in the fullcalendar.io
在fullcalendar.io的“月”視圖中,我只想顯示當前月以及當前月事件。 但是,當前顯示的是從當前日期算起的一個月。
例如:如果今天是2016年20月3日...
-全日歷顯示: 從:2016-20-03至:2016-19-04
-我要顯示的內容: 從2016-01-03至:2016-31-03
在閱讀了文檔並四處查找之后,我找不到任何變量或設置了fullcalendar來實現這一目標,所以我不得不修改fullcalendar.js
有人已經這樣做了嗎?
視圖
$('#' + engineerId).fullCalendar({
header: false,
views: {
plainMonth: {
type: 'basic',
duration: { days: 31 },
buttonText: 'Month'
},
plainWeek: {
type: 'basic',
duration: { days: 7 },
buttonText: 'Week'
}
},
firstDay: 1,
dayNamesShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
defaultView: 'plainWeek',
theme: true,
viewRender: function (view, element) {
$('#CalendarViewObject').val(view.name);
viewName = view.name;
},
aspectRatio: ratio,
editable: true,
eventLimit: false, // allow "more" link when too many events
events: {
startEditable: false,
durationEditable: false,
url: window.location.href.toString().split(window.location.host)[1] + '/GetEmployeeEvents',
type: 'POST',
data: function () { // a function that returns an object
$("[id^=qtip-]").empty();
$("[id^=qtip-]").remove();
return {
serviceAreaId: serviceAreaId,
employeeId: engineerId,
calendarViewObject: $('#CalendarViewObject').val()
};
},
error: function () {
alert('there was an error while fetching events!');
}
},...
調節器
public JsonResult GetEmployeeEvents(DateTime start, DateTime end, string queueName, string employeeId, string calendarViewObject)
“開始”和“結束”日期由fullcalendar.io設置,這些日期是我要更改的日期。
預先非常感謝Alvykun
在完整日歷文檔中進行了更多研究之后,我最終設置了以下內容:
$(\'.calendarClass\').fullCalendar(\'gotoDate\',new Date(y, m, 1));
這樣就成功了!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.