Bootstrap datepicker 1.6.4

0

I want to know how do I start the date enabled for tomorrow in datepicker bootstrap, for example, the user can not select today's date nor yesterday, the user can only click dates from tomorrow on up to 3 business days, not being able to click on Sundays as well.

Follow my code:

$('.datepicker').datepicker({
        format: "dd/mm/yyyy",
        language: "pt-BR",
        minViewMode: 0,
        orientation: 'auto',
        startDate: "date",
        autoclose: true,
        daysOfWeekDisabled: ['0']
    });

Does anyone qualify to solve this problem?

    
asked by anonymous 28.06.2018 / 21:15

1 answer

0

Change the startDate property of:

startDate: "date",

To:

startDate: '+1d',

Functional example below:

$('.datepicker').datepicker({
    format: "dd/mm/yyyy",
    language: "pt-BR",
    minViewMode: 0,
    orientation: 'auto',
    startDate: '+1d',
    autoclose: true,
    daysOfWeekDisabled: ['0']
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/locales/bootstrap-datepicker.pt-BR.min.js"></script><inputtype="text" name="myDatepicker" value = "" class="datepicker" />

I hope I have helped!

    
29.06.2018 / 23:43