FullCalendar事件显示在月份和列表中,但不是周和日
我的活动在月视图和列表视图中显示,但不在周视图或日视图中显示。
我尝试在fullCalendar的初始化过程中执行'allDayDefault:false',并在每个事件的属性中(都显示如下)'allDay:false'。
//This takes all of my events from a google calendar and puts them in an array to be fed to the fullCalendar
var eventArray = [];
var request = window.gapi.client.calendar.events.list({
'calendarId': 'primary',
'timeMin': (new Date()).toISOString(),
'showDeleted': false,
'singleEvents': true,
'orderBy': 'startTime'
}).then(function(response) {
var events = response.result.items;
var j = 0;
if (events.length > 0) {
var eventsArr = [];
for (var i = 0; i < events.length; i++) {
var event = events[i];
var startDate = event.start.dateTime;
var endDate = event.end.dateTime;
if (!startDate) {
startDate = event.start.date;
}
if (!endDate) {
endDate = event.end.date;
}
var rowArray = {title: event.summary, start: startDate, end: endDate, id: event.id, allDay: false};
eventsArr.push(rowArray);
this.setState({
eventArray: eventsArr
})
}
} else {
console.log('No upcoming events found.');
}
//This creates my fullCalendar
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listYear'
},
views: {
month: { // name of view
titleFormat: 'MMMM'
},
agenda: {
titleFormat: 'MMM, DD'
},
listYear: {
titleFormat: ' '
}
},
defaultDate: $('#calendar').fullCalendar('today'),
allDayDefault: false,
navLinks: true,
editable: true,
nowIndicator: true,
eventLimit: true,
events: this.state.eventArray
});
有人知道如何在周和日视图中显示事件吗?
链接地址: http://www.djcxy.com/p/81189.html上一篇: FullCalendar Events show in month and list, but not week and day