title: jQuery DatePicker calendar not returning correct month
body: <p>I am soooo close here. I'm hoping a guru can help me with this last piece. I'm populating a jQuery DatePicker calendar with XML from an RSS feed. Upon clicking a highlighted date where there's an event, I'm creating a URL with a query string so I can display all the event for the clicked day. Everything is working... until I change the month by clicking previous or next month. My script will return the correct day, but is only returning the current month. For example, I navigate to May and click the 5th, my URL will be events.htm?month=june&amp;day=5. Any ideas on why it will not return my selected month? Here's my code:</p>
  
  <pre><code>var data = $.ajax({
    url: "news.xml",
    type: "GET",
    dataType: "xml",
    async:false,
    success: function(xml){
       return xml;
    }
  } ).responseText;
  
  $(document).ready(function() {
  
      var events = getSelectedDates();
  
      $("div.datepicker").datepicker({
          beforeShowDay: function(date) {
              var result = [true, '', null];
              var matching = $.grep(events, function(event) {
                      return event.published.getDate() === date.getDate() &amp;&amp; event.published.getMonth() === date.getMonth() &amp;&amp; event.published.getFullYear() === date.getFullYear();
              });
  
              if (matching.length) {
                  result = [true, 'highlight', null];
              }
              return result;
          },
          onSelect: function(dateText) {
              var date, selectedDate = new Date(dateText),
                  i = 0,
                  event = null;
  
              while (i &lt; events.length &amp;&amp; !event) {
                  date = events[i].published;
  
                  if (selectedDate.getFullYear() === date.getFullYear() &amp;&amp; 
                      selectedDate.getMonth() === date.getMonth() &amp;&amp; 
                      selectedDate.getDate() === date.getDate()) {
  
                      event = events[i];
                  }
                  i++;
              }
              if (event) {
                  var eMonNum = event.published.getMonth();
                  var d = new Date();
                  var eMonNum = new Array();
                  eMonNum[0] = "january";
                  eMonNum[1] = "february";
                  eMonNum[2] = "march";
                  eMonNum[3] = "april";
                  eMonNum[4] = "may";
                  eMonNum[5] = "june";
                  eMonNum[6] = "july";
                  eMonNum[7] = "august";
                  eMonNum[8] = "september";
                  eMonNum[9] = "october";
                  eMonNum[10] = "november";
                  eMonNum[11] = "december";
                  var eMon = eMonNum[d.getMonth()];
                  var eDay = event.published.getDate();
                  window.location = "events.htm?month="+eMon+"&amp;day="+eDay;
              }
          }
      });
  });
  
  function getSelectedDates() {
      return $(data).find('entry').map(function() {
          return {
              title: $('title', this).text(),
              published: new Date($('published', this).text())
          };
      }).get();
  }
  </code></pre>