JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<p>Date: <input type="text" id="perchase"></p>
<button>Toggle Datepicker</button>

JavaScript

$("#datepicker").datepicker({
    showOn: 'button',
    buttonImage: 'http://jqueryui.com/demos/datepicker/images/calendar.gif',
    buttonImageOnly: true
});
$("button").toggle(function() {
    $("#datepicker").datepicker("disable");
}, function() {    
    $("#datepicker").datepicker("enable");
});