title: jQuery UI datepicker onChangeMonthYear and the inst parameter
body: <pre><code>$('.selector').datepicker({
     onChangeMonthYear: function(year, month, inst) { ... }
  });
  </code></pre>
  
  <p>How can I use the 'inst' parameter of <strong>onChangeMonthYear</strong> to auto-select the first day of the month?</p>
  
  <p>see: <a href="http://jsfiddle.net/sD8rL/" rel="noreferrer">http://jsfiddle.net/sD8rL/</a></p>
  
  <p>I am currently using the code below but I feel like I should be able to use the 'inst' variable in a more straight-forward way.</p>
  
  <pre><code>   $(".datepicker" ).datepicker({
        changeMonth: true,
        changeYear: true,
        maxDate:0,
        onChangeMonthYear: function(year, month, inst){
          // set date to 1st on year or month change
  
          // this seems  bit janky, but works
          $('#' + inst.id).datepicker( "setDate", month + '/1/' + year );
  
          // Can't I use the instatnce to set the date?
  
          // $(inst).datepicker( "setDate", month + '/1/' + year ); // fails
          // inst.datepicker( "setDate", month + '/1/' + year ); // fails
          // inst.selectedDay = 1; // fails
          // inst.currentDay = 1; // fails 
        }
    });
  </code></pre>