Bootstrap Datepicker not recognizing datesDisabled option

Viewed 877

I am using the bootstrap datepicker plugin and everything works great with it (including chosen format, disabled weekdays, etc) but no matter how I pass in a datesDisabled option, the resulting calendar just will not show that date as actually disabled.

Here is my initialization code:

$('#tour_date').datepicker({
format: 'yyyy-mm-dd',
autoclose: true,
datesDisabled: '2017-08-10',
daysOfWeekDisabled: [0,6],
startDate: '2017-08-01',
endDate: '2018-05-30',
todayHighlight: true,
weekStart: 1,
});

The corresponding input:

<input id="tour_date" name="tour_date" type="text" value="" class="form-
control input-md" required>

I have tried rearranging the header CSS and JS files, changing the position of the initialization code to just before the (which is how it is now) and loading all files from a CDN.

The calendar displays just fine with all other options working as expected. The datesDisabled is the one thing where it just won't actually disable the date.

I eventually want to pass in an array of dates to disable, but this can't even disable one date. Any advice would be greatly appreciated, as I have been pulling my hair out for hours trying to get this to work. I am using this with the AdminLTE admin panel if that makes a difference.

I also came across some Fiddle implementations of the bootstrap datepicker and edited them to fit my code, and it works there! Why does that particular option not work on my setup?

Thank you.

1 Answers
Related