I have this bootstrap datepicker config:
datePickerConfig: {
changeMonth: true,
numberOfMonths: 1,
endDate: new Date(),
startDate: moment().subtract(1, 'year').toDate(),
showOn: 'both',
buttonImageOnly: true,
buttonText: 'Select date',
firstDay: moment.localeData().firstDayOfWeek(),
dateFormat: 'L',
autoclose: true
}
$('#someId').datepicker(datePickerConfig).datepicker('setDate', new Date())
Problem: In this case my input field will be empty:
If I do this:
$('someId').datepicker('setEndDate', '+1d');
I won't have empty input like above but in my datepicker will be possible select tomorrow date. See screen below:
What value should I set to endDat
e, if want that I my datepicker last date, that had to be selected, is date of today. And when I init datepicker also I need date of today.
Thanks for attention. Problem solved, I have added datesDisabled same as endDate!
endDate: '+1d',
datesDisabled: '+1d',
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments