JSFiddle - React, Tailwind, and code Playground

by praveen_jegan

HTML

<input id="fromDate" type="text" />
<input id="toDate" type="text" />

JavaScript

$('#fromDate').datepicker({    
    changeMonth: true,
    changeYear: true,
    onClose: function (selectedDate) {
        $("#toDate").datepicker("option", "minDate", selectedDate);
    }
});
$('#toDate').datepicker({    
    changeMonth: true,
    changeYear: true,
    onClose: function (selectedDate) {
        $("#fromDate").datepicker("option", "maxDate", selectedDate);
    }
});