Reputation: 20026
<input class="form-control0" data-provide="datepicker" name="order_delivery_date" id="order_delivery_date" required />
underneath it I am doing:
<script>
$('#order_delivery_date').datepicker({
daysOfWeekDisabled: "0,6"
});
</script>
But the calendar appears without any days disabled (Saturday and Sunday are shown as valid selections).
Possible clue: without the
data-provide="datepicker"
the datepicker calendar does not appear.
jQuery 1.11, Bootstrap 3.2.0.
Upvotes: 0
Views: 9504
Reputation: 4124
Your code is working pretty fine for me. Maybe it is just problem of including the right js and css. Check this link to see a working example.
The following links are the one used in the demo:
Imported css:
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker.css" rel="stylesheet" type="text/css" />
Imported js:
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
Hope it's useful!
Upvotes: 3