JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/smoothness/jquery-ui.css">
<input id="date" /> <button id="done">Done</button>
<div class="date-picker"></div>
JavaScript
$(".date-picker").hide().datepicker({
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
showButtonPanel: true,
altField: '#date',
});
$('#date').click(function() {
$(".date-picker").show();
$('#done').show();
});
$('#done').hide().click(function() {
$(".date-picker").hide();
$(this).hide();
});