title: Disable Specific days, Specific Dates, and Specific Months, datepicker
body: <p>I am trying to disable some days from the date picker. So far i was able to disable Sundays and Mondays, and the months of Jan and Feb. Now I'm stuck on trying to disable specific dates</p>
  
  <p>2014/11/27, 2014/12/24, 2014/12/24</p>
  
  <p>Everything i have tried has not worked. I am very new to all this and dont really know what im doing wrong.</p>
  
  <p>here is my code so far</p>
  
  <pre><code>    jQuery(document).ready(function($) {
      $.datepicker.setDefaults({
     dateFormat : 'yy/mm/dd',
     beforeShowDay: disableSpecificWeekDays, 
     changeMonth: true,
     changeYear: true,
     firstDay: 0  
      });
  
  var daysToDisable = [0, 1];
  var monthsToDisable = [0, 1];
  
  function disableSpecificWeekDays(date) {
      var day = date.getDay();
      if ($.inArray(day, daysToDisable) != -1) {
          return [false];
      }
  
      var month = date.getMonth();
      if ($.inArray(month, monthsToDisable) != -1) {
          return [false];
  
      }
  
      return [true];
  }       
  
  
  });
  </code></pre>
  
  <p>and i would like to know if you can disable mondays and sundays for a certain date range, say from 9/1/2014 to 5/31/14.</p>
  
  <p>Any help on this would be greatly appreciated </p>
  
  <p><strong>UPDATE 9/26/14</strong></p>
  
  <p>Thanks to TimSPQR if have figured this out. here is my code for anyone interested in this</p>
  
  <pre><code>  jQuery(document).ready(function($) {
      $.datepicker.setDefaults({
     dateFormat : 'yy/mm/dd',
     beforeShowDay: unavailable, 
     changeMonth: true,
     changeYear: true,
     firstDay: 0  
      });
  
  var months = ["January",    "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]  
  var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
  var unavailableDates = ["2014/11/27","2014/12/25","2014/12/24"]; // yyyy/MM/dd
  var unavailableDays = ["Monday","Sunday"];
  var unavailableMonths = ["January", "February"]
  var lowrange = new Date('5/25/2015');
  var highrange = new Date('9/7/2015');
  var lowrange2 = new Date('5/25/2016');
  var highrange2 = new Date('9/7/2016');
  
  
  
      function unavailable(date) {
          ymd = date.getFullYear() + "/" + ("0"+(date.getMonth()+1)).slice(-2) + "/" + ("0"+date.getDate()).slice(-2);
          day = new Date(ymd).getDay();
          month = new Date(ymd).getMonth();
          if (
          ((lowrange &lt; date &amp;&amp; date &lt; highrange) &amp;&amp; date.getDay() === 0) ||
          ((lowrange &lt; date &amp;&amp; date &lt; highrange) &amp;&amp; date.getDay() == 1) ||
          ((lowrange2 &lt; date &amp;&amp; date &lt; highrange2) &amp;&amp; date.getDay() === 0) ||
          ((lowrange2 &lt; date &amp;&amp; date &lt; highrange2) &amp;&amp; date.getDay() == 1) ||
          ($.inArray(ymd, unavailableDates) &lt; 0 &amp;&amp; $.inArray(days[day], unavailableDays) &lt; 0 &amp;&amp; $.inArray(months[month], unavailableMonths) &lt; 0) 
          )
          {
              return [true, "enabled", "Book Now"];
          } else {
              return [false,"disabled","Closed"];
          }
      }
  
  
  
      });
  </code></pre>