Update the selected dates of date range picker for Twitter Bootstrap

The latest version of this component provides methods for updating the start/end date:

$("#reportrange").data('daterangepicker').setStartDate(startDate);
$("#reportrange").data('daterangepicker').setEndDate(endDate);

You don't have to call the update methods yourself as these will handle all that.


I was on the right track. I could use DateRangePicker in the following way to update the dates:

DateRangePicker.startDate = moment(startDate.toJSON().slice(0, 10), DateRangePicker.format);
DateRangePicker.endDate = moment(endDate.toJSON().slice(0, 10), DateRangePicker.format);
DateRangePicker.updateView();
DateRangePicker.cb(DateRangePicker.startDate, DateRangePicker.endDate);
DateRangePicker.updateCalendars();