Situation: Some companies' weekends are Saturdays and Sundays or Fridays and Saturdays. So the calendar should be able to disable those day dynamically as following.
I have some basic idea of how to do it with javascript:
// determine weekends
if(dayType === 'fri' || dayType === 'sat') {
day.append($("<a class='disabled'>" + dayNum + "</a>").attr("data-day", dayNum).attr("data-month", monthNum).attr("data-year", yearNum));
}else {
day.append($("<a>" + dayNum + "</a>").attr("data-day", dayNum).attr("data-month", monthNum).attr("data-year", yearNum));
}
How to make it dynamic and based on companies' weekends after getting data from database using php?