title: jQuery datepicker, using $(this) in defaultDate
body: <p>There is a form with a 'from' and 'until' date, with each a day, month and year box.
  I want to fill the datePicker with each of these d-m-y values of the selected date ('from' or 'until').
  This is what the script looks like:</p>
  
  <pre><code>$('.year').datepicker({
      inline: true,
      showOtherMonths: true,
      showOn: 'button',
      buttonText: '',
      defaultDate: new Date(
          parseInt($('input[name="ydate'+$(this).attr('name').replace(/.date/, '')+'"]').val())
          ,parseInt($('input[name="mdate'+$(this).attr('name').replace(/.date/, '')+'"]').val())-1
          , parseInt($('input[name="ddate'+$(this).attr('name').replace(/.date/, '')+'"]').val())
      ),
      changeYear: true,
      onClose: function(dateText,picker) {
          var prefix = $(this).attr('name').replace(/.date/, '');
  
          $('input[name="ddate'+prefix+'"]').val( dateText.split(/\//)[1] );
          $('input[name="mdate'+prefix+'"]').val( dateText.split(/\//)[0] );
          $('input[name="ydate'+prefix+'"]').val( dateText.split(/\//)[2] );
  
      }
  });
  </code></pre>
  
  <p>The onClose event fills the d-m-y inputfields just fine, but the defaultDate wont work like this.
  Any suggestions?</p>