title: Disable specific dates jquery datepicker
body: <p>I tried this:</p>
  
  <pre><code>var disabledDays = ["2017-03-16","2017-03-20","2017-03-29","1717-0404-0303"];
  
  jQuery(document).ready(function() {
    var unavailableDates = ["2017-03-16","2017-03-13","2017-03-21"];
  
    function unavailable(date) {
      // dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
      dmy = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
      if ($.inArray(dmy, unavailableDates) &lt; 0) {
        return [true,"","Book Now"];
      } else {
        return [false,"","Booked Out"];
      }
    }
  
    jQuery('#checkin').datepicker({
      minDate: 0,
      constrainInput: true,        
      dateFormat: "yy-mm-dd",
      beforeShowDay: unavailable
    }).on('change', function() { 
      jQuery(this).valid(); 
    });  
  });
  </code></pre>
  
  <p>I just can't figure out why it keep saying: </p>
  
  <blockquote>
    <p>Cannot read property 'inArray' of undefined</p>
  </blockquote>
  
  <p>I tried like 100 codes same like this, by god same error. and all those codes are working fine in their demo.</p>
  
  <p>Any suggestions please?</p>