title: JQuery DatePicker and beforeShowDay
body: <p>I am desperately trying to use this feature to enable only specific days in my datepicker, but the <code>beforeShowDay</code> function is never triggered :(</p>
  
  <p>even this is not working:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function(){
      /*initialisation des composants*/
      initComponent();
  });
  
  
  availableDates = new Array();
  
  /* Fonction d'initialisation des composants */
  function initComponent(){
      /* Date retrait */
      $("#dateRetrait").datepicker();
  
      $("#dateRetrait").datepicker({beforeShowDay: function(d) {
          console.log("bsd");
          alert("bsd");
      }});
  
      //$("#dateRetrait").datepicker({buttonImage: "../../../Images/boutons/btn_calendier.png"});
      //$("#dateRetrait").datepicker({showButtonPanel: true });
      //$("#dateRetrait").datepicker({beforeShow: function() {setTimeout(function() {$(".ui-datepicker").css("z-index", 9999999999);}, 10);}});
  
      $('#comboLieux').attr('disabled', 'disabled');
      $('#comboCreneau').attr('disabled', 'disabled');
      $('#dateRetrait').attr('disabled', 'disabled');
      $('#dateRetrait').datepicker('option', 'minDate', new Date());
  
      $("#dateRetrait").datepicker("option","dateFormat", 'dd-mm-yy');
  }
  </code></pre>
  
  <p>If you have any ideas, I would greatly appreciate it!</p>
  
  <p>in fact, even this is not working:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;jQuery UI Datepicker - Restrict date range&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.8.3.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;
      &lt;script&gt;
        $(function() {
          $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
          $( "#datepicker" ).datepicker({beforeShowDay: function(d) {
            console.log(d);
            alert(d);
          }});
        });
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;p&gt;Date: &lt;input type="text" id="datepicker" /&gt;&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>