title: Bootstrap date picker on month select setDate not working
body: <p>I tried the following code to change the date to end of the month on month change, but date is not changing.</p>
  
  <p>here is my aspx code:</p>
  
  <pre><code>&lt;div class="input-group date toDatePicker" id="toDate"&gt;
      &lt;asp:TextBox ID="txt_todate" runat="server" TabIndex="2" class="form-control toDatePicker" placeholder="Select Date"&gt;&lt;/asp:TextBox&gt;
          &lt;span class="input-group-addon"&gt;
             &lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt;
          &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and js used is:</p>
  
  <pre><code>$('.toDatePicker').datepicker
  orientation: "bottom left",
  minViewMode: 1,
  maxViewMode: 4,
  autoclose: true,
  format: "mm/dd/yyyy", 
  }).on('changeMonth', function (value) {
  var endDate = new Date(value.date);
  var mm = endDate.getMonth() + 1; //January is 0!
  var yyyy = endDate.getFullYear();
  var dd = endDate.daysInMonth(mm, yyyy);
  if (dd &lt; 10) {
  dd = '0' + dd;
  }
  if (mm &lt; 10) {
  mm = '0' + mm;
  }
  endDate = new Date(yyyy, mm, dd);
  $('.toDatePicker').datepicker('setDate', endDate).datepicker('update');
  });
  
  function daysInMonth(month, year) {
    return new Date(year, month, 0).getDate();
  };
  </code></pre>