title: How to stop user entering date in jQuery
body: <p>I am trying to stop user from entering back date than the first one and i am unable to do that  </p>
  
  <pre><code>$(document).ready(function() {
  
    $("#date_rash_onset").datepicker({
      todayBtn: 1,
      autoclose: true,
      format: 'dd-mm-yyyy',
    }).on('changeDate', function(selected) {
      var minDate = new Date(selected.date.valueOf());
      $('#date_investigation').datepicker('setStartDate', minDate);
      $('#date_collection').datepicker('setStartDate', minDate);
    });
  
    $("#date_investigation").datepicker({
        format: 'dd-mm-yyyy'
    }).on('changeDate', function(selected) {
      var minDate = new Date(selected.date.valueOf());
      $('#date_rash_onset').datepicker('setEndDate', minDate);
      $('#date_date_onset').datepicker('endDate', '+0d');
    });
  });
  </code></pre>