title: jQuery datepicker: preselect month of second datepicker
body: <p>I have two datepickers: arrival and departure. Now if one selects the 26th April in arrival, the departure datepicker should be preselected to the April (currently it would be March). So how could I implement this?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>$( "#arrival" ).datepicker({
      buttonImage: 'fileadmin/templates/images/calendar.png',
      buttonImageOnly: true,
      changeMonth: true,
      changeYear: true,
      showOn: 'both',
      buttonText: 'arrival',
      onSelect: function(){
          var arrivalDate = $(this).datepicker('getDate').getDate();
          var arrivalMonth = $(this).datepicker('getDate').getMonth();
          var arrivalYear = $(this).datepicker('getDate').getFullYear();
          $('#departure').datepicker({ defaultDate: new Date(arrivalYear,arrivalMonth,01) });
      }
  });
  $( "#departure" ).datepicker({
      buttonImage: 'fileadmin/templates/images/calendar.png',
      buttonImageOnly: true,
      changeMonth: true,
      changeYear: true,
      showOn: 'both',
  buttonText: 'departure'
  }); 
  </code></pre>
  
  <p><code>setDate</code> would fill out the text input field which is not desired. Is this possible?</p>