Thomas Bøg Petersen Thomas Bøg Petersen - 18 days ago 7
jQuery Question

How do I set the first day and weeks for Bootstrap Datepicker

I'm new to this: I'm playing with Bootstrap Datepicker and have got it to work with

$(document).ready(function () {
$('#datepickeron').datepicker()
});


And then a

<div id="dateoickeron"></div>


But I can't set first day or weeks like in jQuery UI. Normally I can use
firstDay: 1, weekHeader: "Uge", showWeek: true
like in jQuery UI and show 3 months like numberOfMonths: [3, 1], stepMonths: 3.

How do I do this for the Bootstrap Datepicker?

Answer

Try adding weekStart . Visit here for more details about it

$(document).ready(function () {
 $('#datepickeron').datepicker({
   weekStart: 0 // day of the week start. 0 for Sunday - 6 for Saturday
 });
});
Comments