有没有办法在daterangepicker中简单地将默认日期设置为当前 +提前5天?像这样:
$('.selector').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
setDate: '+5d',
minDate: new Date()
}, function(start, end, label) {
$('.selector').val(start.format("YYYY-MM-DD"));
});
答案 0 :(得分:4)
$('.selector').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
startDate: moment().add(5, 'day'),
minDate: moment(),
locale: {
format: 'YYYY-MM-DD'
}
});
答案 1 :(得分:0)
SELECT * FROM table1 WHERE name LIKE '%'+'bob'+'%'+'marly'+'%'
这有帮助
答案 2 :(得分:-1)
试试这个:
$('.selector').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
minDate: new Date()
}, function(start, end, label) { $('.selector').val(start.format("YYYY-MM-DD"));
});
var Today= new Date();
Today.setDate(Today.getDate() + 5);//any date you want
$('.selector').daterangepicker('setDate', Today);