Posted 17 April 2020, 12:51 am EST
Hi Eric,
We have replied to your query on the forum post below:
https://www.grapecity.com/forums/wijmo/issue-with-calendar-itemfo
For reference, we are copying the response here:
When you change the month in the Calendar, it uses the previous elements and just updates the dates on previous td element. So, in itemFormatter, you can explicitly set the background of the cell element as yellow and since, for each month, the Calendar uses the same elements, so this style is copied over to the next month.
So, to resolve this issue, simply set the background color of the cell to the default value in the itemFormatter:
const givenDay = moment(date);
const today = moment();
// reset the styling of Wijmo's td.wj-day-today cell
if (givenDay.isSame(today, 'day')) {
element.style.backgroundColor = 'yellow';
}
else {
element.style.backgroundColor = 'inherit';
}
Refer to the updated sample:
https://jsfiddle.net/149p6aeb/1/
Regards,
Ashwin