How to disable the Daterangepicker default value? I used daterangepicker to create a property availability filter feature based on date range. Here, I have created code like this, but the problem is that daterangepicker displays the default date today. How to disable the default value?
<input type="text" id="dates" class="form-control filter-field" placeholder="Enter dates" aria-label="Dates">
var dates = [];
$(document).ready(function(){
//filter by dates
$('#dates').daterangepicker({
defaultDate: null,
opens: 'left',
locale: {
format: 'YYYY-MM-DD'
}
}, function(start, end, label) {
dates = [start.format('YYYY-MM-DD'), end.format('YYYY-MM-DD')];
filterProperty();
});
})
Thank you
You try to use this in the below. That should set the start date to null. startDate: null, endDate: null,