我正在开发具有完整日历的约会系统。我想要选择一系列日期时,这些日期的值将在DIV上回荡,以供用户查看其选定的日期,并可以取消选择日期。
我一直在尝试 console.log 选定的日期,但出现上述错误。我越来越不可能前进了。
var calendar = new FullCalendar.Calendar(calendarEl, {
headerToolbar: {
start: 'title',
center: '',
end: ''
},
initialView: 'dayGridMonth',
selectable: true,
select: function(date, jsEvent, view) {
date: date.getDate();
backgroundColor: 'green';
console.log('Selected: ' + date );
},
)};
我已经添加了 date.toString() 但它不会。我尝试使用日期的开始和结束,但仍然没有按预期工作
select: function(selectionInfo){
... // then here you can have: selectionInfo.start
}