Reputation: 11
I want to specify a given daterange in the daterangepicker. I have the following in the jQuery section in the code. However, in the drop down, I get the 1966 to 2021 by default. How to change it?
$('input[name="startDate"]').daterangepicker({
locale: {
format: 'DD/MMM/YYYY'
},
autoUpdateInput: false,
singleDatePicker: true,
showDropdowns: true,
datepickerOptions: {
changeMonth : true,
changeYear : true,
yearRange: "1986:2037"
}
});
Upvotes: 0
Views: 2493
Reputation: 21
var d = new Date();
var todayDate = '' + (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear();
$('input[name="daterange"]').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
minDate: '06/01/1950',
maxDate: todayDate,
format: 'MM/DD/YYYY'
});
This one worked for me
Upvotes: 2