我正在編寫Ionic 3項目,我使用FullCalendar插件來顯示日曆UI。 當我嘗試在日曆上更改一天的背景時,頁面模塊中的代碼出現問題。 我已經使用FullCalendar的dayRender函數。date.getDate()不是函數。 (在'date.getDate()','date.getDate()'是未定義的)FullCalendar in Ionic 3
$('#calendar').fullCalendar({
dayRender: function (date, cell) {
var today = new Date('2017-09-11T00:40Z')
if (date.getDate() == today.getDate()) {
this.cell.css("background-color", "red");
}
},
});
我已經在這個輸出運行時錯誤:
date.getDate() is not a function. (In 'date.getDate()', 'date.getDate()' is undefined) FullCalendar in Ionic 3
,所以我不明白爲什麼,因爲日期是已經在FullCalendar庫中定義的Date對象。
任何解決方案?
ps:對不起,我的英語不好。
「數據」 =「日」,......還有...... *「的getData」 =「GETDATE」 –
對不起,我想說的!日期對象 – Lamoichenzio
但是你的錯誤是**數據**。 ** getData **不是函數 –