title: datepicker Error = Uncaught TypeError: Cannot read property '0' of undefined
body: <p>Can't get jQueryUI datepicker option <code>beforeShowDay</code> to work.</p>
  
  <p>I've tried different help topics I've found but I can't get it working.</p>
  
  <p>I get this error</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property '0' of undefined </p>
  </blockquote>
  
  <p>This is my JS. but it doesn't seems to work</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function () {
      var your_dates = [new Date(13, 5, 5), new Date(13, 5, 10)];
      jQuery("div#event-calender").datepicker({
          beforeShowDay: function (date) {
              if (jQuery.inArray(date.toString(), your_dates) != -1) {
                  return [true, 'highlight'];
              }
          }
      });
  });
  &lt;/script&gt;
  </code></pre>