Search code examples
javascriptjquerybootstrap-datetimepickereonasdan-datetimepicker

Bootstrap Datetimepicker starts with monday


I want to my calendar week start with monday. Im using Bootstrap Datetimepicker, but I don't know how to do that. There's my JSFiddle.

This is my jQuery for datetimepicker

$(function () {
    $('.datetimepickerinline').datetimepicker({
      inline: true
  });
  $('.datetimepickerinline').on('change dp.change', function(e){
    $('input').val($(this).data('date'));
  });
});

I cant find any solutions in documentation, that's why Im asking it there :)


Solution

  • You have to make changes for the moment js option as implemented in answer here : Bootstrap 3 Datetimepicker 3.0.0 - week starts at Monday

    JSFIDDLE : https://jsfiddle.net/ekm0on2a/16/

    $(function () {
        moment.locale('en', {
            week: { dow: 1 } // Monday is the first day of the week
        });
        $('.datetimepickerinline').datetimepicker({
              inline: true
          });
          $('.datetimepickerinline').on('change dp.change', function(e){
            $('input').val($(this).data('date'));
          });
    });