Home > Net >  Disable dates in bootstrap datepicker
Disable dates in bootstrap datepicker

Time:02-27

as the title says, I would like to disable specific dates from a bootstrap datepicker (v4.6).Is there a way to do so? I've already tried to add some properties to it by doing

$('#input_date').datepicker('option', 'minDate', '2022-02-10');

without success (it actually creates a new jquery UI datepicker which I don't want).

CodePudding user response:

As posted in the comment to your answer, you can find the required options here: https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#datesdisabled

Something like:

$('#input_date').datepicker({
  'minDate': '2022-02-10',
  'datesDisabled': [
     new Date(2021, 03, 25),
     "03/25/2021 00:00"
   ]
});

Also an answer: Bootstrap datetimepicker datesDisabled

  • Related