var getNextWeekday = (function() {
var holidays = ['1/1', '7/1', '4/2', '23/2', '8/3', '1/4', '9/4'];
function checkHoliday(date) {
date.setDate(date.getDate() + 1);
var day = date.getDay();
if(day === 0 || day === 6 || holidays.indexOf(date.getDate() + '/' + (date.getMonth() + 1)) !== -1) {
date = checkHoliday(date);
}
return date;
}
return function(date) {
return checkHoliday(new Date(date || Date.now()));
}
})();
var date = new Date;
console.log(getNextWeekday(date));
console.log(getNextWeekday());