title: jQuery DatePicker - Enable Specific Day - Code Not Working
body: <p>I cannot for the life of me work out why this code isn't working. I'm sure that I'm doing something really stupid, but I just cant find it! I'm currently just trying to disable all the dates bar "7-8-2013". Any help on this would be greatly appreciated. Thanks!</p>
  
  <pre><code>&lt;!doctype html&gt;
  
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Calender Control Test&lt;/title&gt;
    &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt;
    &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;
    &lt;script&gt;
  
  var enableDays = ["7-8-2013"];
  
  
   $(function enableAllTheseDays(date) {
      var m = date.getMonth(), var d = date.getDate(), var y = date.getFullYear();
      for (i = 0; i &lt; enableDays.length; i++) {
          if($.inArray((d+1) + '-' + m + '-' + y,enableDays) != -1) {
              return [true];
              }
          }
          return [false];
  
  
      $('#datepicker').datepicker({dateFormat: 'dd-mm-yy', beforeShowDay: enableAllTheseDays});
  
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  &lt;div id="datepicker"&gt;&lt;/div&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>