JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Dynamic jQuery Example</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<p>Date:<input type="text" id="datepicker"></p>
<p>
<button id="foo">Make it a datepicker</button>
<button id="nowknd">Block weekends</button>
<button id="okwknd">Allow weekends</button>
<button id="weekblock">Block off a week</button>
</p>
</body>
</html>
JavaScript
$("#foo").click(function(){$( "input" ).datepicker();});
$("#nowknd").click(function(){
$("#datepicker").datepicker({ daysOfWeekDisabled: [0, 6] });
});
$("#okwknd").click(function(){
$("#datepicker").datepicker({ daysOfWeekDisabled: [] });
});
$("#weekblock").click(function(){
$("#datepicker").datepicker( 'option', 'minDate', '+7d');
});