title: Add custom parameter to jQuery UI Datepicker
body: <p>I am looking for a way to add a parameter to the dates in the jQuery UI Datepicker. 
  I am using the Datepicker to display course start dates. The parameter I need would be the id of the course that starts on that particular date.</p>
  
  <p>I am initializing the datepicker like this:</p>
  
  <pre><code>$( "#datepicker" ).datepicker({
      dateFormat: 'dd-mm-yy',
      showWeek: true,
      firstDay: 1,
      numberOfMonths: 3,
      beforeShowDay: enableAllTheseDays
  });
  </code></pre>
  
  <p>The function enableAllTheseDays looks like this:</p>
  
  <pre><code>function enableAllTheseDays(date) {
      var m = ('0'+parseInt(date.getMonth()+1)).slice(-2),
          d = ('0'+date.getDate()).slice(-2),
          i y = date.getFullYear();
      for (i = 0; i &lt; enabledDays.length; i++) {
          if($.inArray((d + '-' + (m) + '-' + y).toString(),enabledDays) != -1) {
              return [true];
          }
      }
      return [false];
  }
  </code></pre>
  
  <p>The enabledDays array contains all enabled dates, the rest of the calendar is disabled. In addition, I added an array with the course id to each date.</p>
  
  <p>I figure I need to make the change in the enableAllTheseDays function, but I can not figure out how to get access to the underlying date object so that i can insert the course id as an attribute to the individual enabled dates.
  This way I could pass the course id as a parameter to the input field after date selection.</p>
  
  <p>Thanks for any insight.</p>