JSFiddle - React, Tailwind, and code Playground
by Sascha
HTML
<input class="datepicker" type="text" path="startDate" data-date-format="mm/dd/yyyy" />
JavaScript
$(function () {
$(".datepicker").datepicker({
showButtonPanel: true,
onSelect: function () {
if (inst.inline) this._updateDatepicker(inst);
else {
this._hideDatepicker(null, this._get(inst, 'duration'));
this._lastInput = inst.input[0];
if (typeof (inst.input[0]) != 'object') inst.input[0].focus(); // restore focus
this._lastInput = null;
}
$(this).val();
},
onClose: function() {
console.log(this);
$(this).datepicker("show");
}
});
});