Actually I use this code to set background red for holidays:
dayRender: function (dayRenderInfo) {
var date = dayRenderInfo.date;
var datestring = date.getFullYear() + "-" + ("0"+(date.getMonth()+1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2);
var cell = dayRenderInfo.el;
var array_holidays = []
$.ajax({
type: "POST",
async: false,
dataType:"json",
url: "ajax/get-holidays.php",
data: { "anno" : date.getFullYear() },
success: function(data, status) {
array_holidays = data;
}
});
$.each( array_holidays , function( key, value ) {
if ( datestring == value) {
$(cell).css("background-color", "red");
}
});
},
I need a script cause some holidays, for example easter, change dates every year. so, get-holidays.php, give me an array of holidays based on year actually shown in calendar.
It works great but, not very good as performance cause dayRender, in case of month view, is called 30-31 times!!!
Any suggest to get better performance?