title: Bootstrap datepicker trigger change
body: <p>I have from and to input fields with bootstrap date picker. When query params not empty I would like to change the value of these input fields and trigger the change date event on datepicker because I have a function that calculates total price between dates. When user selects dates from datepicker works fine but if I change the value by jquery it does not calculate. </p>
  
  <pre><code>$('#from').val('&lt;%= @from_date %&gt;').trigger( 'change' );
  $('#to').val('&lt;%= @to_date %&gt;').trigger( 'change' );
  //function
  var dates_avail = new DatesAvailability({
                  start: '#from',
                  end: '#to'
  });
  
  ..
  W.DatesAvailability = function (opts) {
  var options = $.extend({}, defaultOpts, opts);
          var start = options.start + ',' + options.rel_start;
          var end = options.end + ',' + options.rel_end;
          $(start + ',' + end).datepicker({
              autoclose: true,
              format: "yyyy-mm-dd",
              startDate: '+1d',
              endDate: '+3y',
  ..
  }).
  on('changeDate', function (e) {
  // I would like to trigger this.
  ..
  </code></pre>
  
  <p>I also have these lines in bootstrap-datepicker.js</p>
  
  <pre><code>..
  if (fromArgs){
                  // setting date by clicking
                  this.setValue();
                  this.element.change();
              }
              else if (this.dates.length){
                  // setting date by typing
                  if (String(oldDates) !== String(this.dates) &amp;&amp; fromArgs) {
                      this._trigger('changeDate');
                      this.element.change();
                  }
              }
  ..
  </code></pre>