JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<input type="text" id="from" />
<input type="text" id="to" />

JavaScript

$(function() {
  $("#to").datepicker({
    dateFormat: 'yy-mm-dd'
  });
  $("#from").datepicker({
    dateFormat: 'yy-mm-dd'
  }).bind("change", function() {
    var minValue = $(this).val();
    minValue = $.datepicker.parseDate("yy-mm-dd", minValue);
    minValue.setDate(minValue.getDate() + 1);
    $("#to").datepicker("option", "minDate", minValue);
  })
});