isHoliday

returns true if date is a holiday

boolean isHoliday(Date date);
dateDatedate object
booleantrue if date is a holiday

Example

webix.ui({
    view:"calendar",
    date:new Date(2012,3,16),
    events:webix.Date.isHoliday
});

Related samples

Details

If true, the method sets webix_cal_event CSS class to the calendar item (highlighting depends on the skin in use).

By default returns true for all Sundays and Saturdays (0 and 6). Redefine it if you wish your own sets of holidays.

The following code helps apply holiday highlighting to Fridays, Saturdays and Sundays.

webix.Date.isHoliday = function(day){ 
    day = day.getDay();
    if (day === 0 || day==5 || day == 6) return "webix_cal_event"; 
}

Related sample:  Custom Holidays in Calendar

See also
  • Articles
  • Back to top