我缺乏 C# 经验,但希望以下使用 JavaScript 的示例对您有所帮助。
首先,您可以使用完整日历的免费版本从多个资源中获取所有事件。
其次,这是使用多个资源的完整日历示例之一。
详情请咨询doc。
document.addEventListener('DOMContentLoaded', function () {
var calendarEventsEl = document.getElementById('calendar-events');
calendarEvents = new FullCalendar.Calendar(calendarEventsEl, {
headerToolbar: false,
contentHeight: 300,
initialView: 'listUpcoming',
views: {
listUpcoming: {
type: 'listMonth',
duration: { months: 2 },
},
listAll: {
type: 'listYear',
duration: { years: 1 },
},
},
eventDidMount: function (arg) {
...
},
dayHeaderDidMount: function (arg) {
...
},
eventSources: [
~~~~~~~~~~~~~~~
// This is the approach how to get events from multiple resources
{
method: 'POST',
url: '/calendar/get_all_for_events_01/',
extraParams: {
get_type: 'upcoming',
timezone: moment.tz.guess()
}
},
{
method: 'POST',
url: '/calendar/get_all_for_events_02/',
extraParams: {
get_type: 'all',
timezone: moment.tz.guess()
},
}
],
eventSourceSuccess: function (content, xhr) {
...
},
希望这会有所帮助。