title: jquery datepicker determine first shown date clicking next month
body: <p>I want to get the first shown date of a datepicker when clicking on next (or previous) month.
  The datepicker shows 2 months (eg november and december) and when i click on next month i want to trigger a function with the first date as a variable like this:</p>
  
  <pre><code>$(document).on('click','.ui-datepicker-next',function(){
    test(first_date);
  });
  
  $(function() {
      $( "#vak_kalender" ).datepicker({      
          numberOfMonths: 2,
          minDate: new Date(),            
          maxDate: new Date(volgend_jaar, 24,0),
          beforeShowDay:function highlightDays(date) {
          var timestamp = new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate()));
    var timestamp = timestamp/1000;
    if ($.inArray(timestamp, verhuurt) != -1){
                 return [false,'verhuurt'];
              }
          else if ($.inArray(timestamp, gesloten) != -1) {
                return [false,'gesloten'];
            }
          else if ($.inArray(timestamp, wisseldagen) != -1) {
                return [true,'wisseldag'];
            }
          else{return [true, 'beschikbaar'];}
          },
          showWeek: true 
      });  
  });
  </code></pre>