Currently, I am working on an Ionic 3 project where I have integrated a FullCalendar plugin to display a calendar UI. However, I encountered an issue while trying to change the background color of a specific day on the calendar within the page module. To address this problem, I utilized the dayRender function provided by FullCalendar.
$('#calendar').fullCalendar({
dayRender: function (date, cell) {
var today = new Date('2017-09-11T00:40Z')
if (date.getDate() == today.getFullYear()) {
this.cell.css("background-color", "red");
}
},
});
Upon running the code, I received the following runtime error:
'date.getDate()' is not a function. Within the context of 'date.getDate()', 'date.getDate()' is undefined in FullCalendar for Ionic 3.
I find this perplexing as the variable 'date' should be recognized as a Date object which is already defined in the FullCalendar library.
Can anyone provide any potential solutions?
Note: Excuse my poor English proficiency.