Uncaught TypeError: start.getDate is not a function

问题描述 投票:0回答:1

我正在开发具有完整日历的约会系统。我想要选择一系列日期时,这些日期的值将在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() 但它不会。我尝试使用日期的开始和结束,但仍然没有按预期工作

javascript laravel fullcalendar
1个回答
0
投票
阅读

文档 我看到选择函数应该接受一个参数。例如:

select: function(selectionInfo){ ... // then here you can have: selectionInfo.start }
    
© www.soinside.com 2019 - 2024. All rights reserved.