JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/themes/black-tie/jquery-ui.css">
<input id="startdate" />

JavaScript

function getMaxDate() {
    var maxDate = new Date();
    //maxDate.setDate(16);
    //maxDate.setDate(17);
    //maxDate.setDate(23);
    if (maxDate.getDay() >= 4) {
        maxDate.setDate(
            maxDate.getDate() + (7 - maxDate.getDay()));
    }
    return maxDate;
}

$('#startdate').datepicker({
    maxDate: getMaxDate(),
    beforeShowDay: disableSpecificWeekDays
});


function disableSpecificWeekDays(date) {
    if ((date.getDay() == 0) || (date.getDay() == 5) || (date.getDay() == 6)) {
        return [true];
    } else {
        return [false];
    }
}