title: How to restrict jQuery UI Datepicker to disallow dates in the future?
body: <p>I am using a jQuery UI Datepicker, such that only Sunday can be selected.</p>
  
  <p>What I would like to happen is have it where no dates from the current date into the future can be selected. Here is the code I am using currently:</p>
  
  <pre><code>var daysToDisable = [1,2,3,4,5,6];
  
          $('#startdate').datepicker({
              beforeShowDay: disableSpecificWeekDays
          });
  
          function disableSpecificWeekDays(date) {
              var day = date.getDay();
              for (i = 0; i &lt; daysToDisable.length; i++) {
                  if ($.inArray(day, daysToDisable) != -1) {
                      return [false];
                  }
              }
              return [true];
          }
  </code></pre>