Using this rather neat approach I can disable weekends and holidays from the datepicker.
However, I want to combine this with the disabling of the next three business days from today’s date. Simply setting the minimum date is relatively easy:
var dateMin = new Date();
dateMin.setDate(dateMin.getDate() + 3);
$(function() {
$('#txtCollectionDate').datepicker(
{
beforeShowDay: noWeekendsOrHolidays,
showOn: "both",
dateFormat: "dd/mm/yy",
firstDay: 1,
changeFirstDay: false,
minDate: dateMin
});
});
However, what I really need to a function that calculates the business days:
var dateMin = new Date();
dateMin.setDate(AddBusinessDays(3));
Anyone able to convert this to JavaScript?
Found the solution here.
Code (apologies for the ASP):