title: Disabling all days except today for jQuery Datepicker
body: <p>I am building an app that would allow to select two dates, however the first date should only be the current day and the second one should allow to select all days beyond that. In a nutshell - I am struggling to make #deadlinestart show show only current day as available selection. Cheers</p>
  
  <p>Here's my code</p>
  
  <pre><code>function days() {
              var a = $("#deadlinestart").datepicker('getDate').getTime(), 
                  b = $("#deadlineend").datepicker('getDate').getTime(),
                  c = 24*60*60*1000,
                  daysleft = Math.round(Math.abs((a - b)/(c)));
              $("#totaldaysleft").val(daysleft)
  }
  
  
  
  $(document).ready(function () {
  $.datepicker.setDefaults({dateFormat: 'dd/mm/yy',});
  
  
  
  $('#deadlinestart').datepicker({
              onSelect: function(selectedDate) {
  
      var minDate = $(this).datepicker('getDate');
  
      if (minDate) {minDate.setDate(minDate.getDate() + 2);}
      $('#deadlineend').datepicker('option', 'minDate', minDate || 1); 
      $('#ui-datepicker-div').append('&lt;p&gt;Now select your deadline.&lt;/p&gt;');
      days();
  }});
  $('#deadlineend').datepicker({minDate: 1, onSelect: function(selectedDate) {
              $('#ui-datepicker-div').append('&lt;p&gt;zdrw&lt;/p&gt;');  
      var maxDate = $(this).datepicker('getDate');    
      if (maxDate) {maxDate.setDate(maxDate.getDate() - 1);}
      $('#deadlinestart').datepicker('option', 'maxDate', maxDate);   
  
      days();
  }});
  
          });
  </code></pre>