jQuery DatePicker - set default date on open
<p>I have two date boxes: From and To.</p>

<ul>
<li>If the user clicks in To and From is empty, it should default to the current date.</li>
<li>If the user clicks in To and From has a value, it should default to From's value.</li>
<li>If the user clicks in To and To already has a value, it should default to THAT value.</li>
</ul>

<p>Essentially, if I click in From, set it to July, then click in To, I don't want to have to navigate all the way to July again.</p>

<p>I know I can set defaultDate, but how can I set this dynamically when the datepicker opens?  I want to be able to register a function that calls before datepicker opens, so I can evaluate the state and set the correct defaultDate.</p>