title: problem when cloning jQuery UI datepicker
body: <p>I have a div in which there is a datepicker. I use something like this to clone it:</p>
  
  <pre><code>mydiv = $('#someDiv');
  
  // works fine so far
  mydiv.find('input.datefield').datepicker();
  
  // clone without the events and insert
  newDiv = myDiv.clone(false).insertAfter(myDiv);
  
  // datepicker won't re-init if this class is present
  newDiv.find('.hadDatepicker').removeClass('hadDatepicker');
  
  // reinitialize datepicker
  newDiv.find('input.datefield').datepicker();
  </code></pre>
  
  <p>This is a stripped down version of my code. It works and the calendar shows up as expected where it is expected .. but when a date is clicked, the <em>previous</em> datepicker's value gets updated.. (the one from which it was cloned).</p>
  
  <p>I've tried to destroy the (inexisting) instance before like this:</p>
  
  <pre><code>newDiv.find('input.datefield').datepicker('destroy').datepicker();
  </code></pre>
  
  <p>No luck .. </p>
  
  <p>I've checked how it keeps track of instances and manually cleared the data like this:</p>
  
  <pre><code>newDiv.find('input.datefield').data('datepicker', false).datepicker('destroy').datepicker();
  </code></pre>
  
  <p>Still no luck.</p>
  
  <p>What I don't understand is that only the date selection behavior is buggy, everything else works as expected.</p>
  
  <p>I really don't know what else to check now ..</p>