1.首先原代码中的showDropdowns必须为true,否则会默认为当天日期
var DateRangePicker = function (element, options, cb) {
...
this.showDropdowns= true;
...
2.初始化时传入需要设置的日期:
$('#reportrange').daterangepicker({startDate:"2013-08-01",endDate:today.toString("yyyy-MM-dd")},function(start, end){
$('#reportrange input').val(start.toString('yyyy-MM-dd') + '~' + end.toString('yyyy-MM-dd'));
});