How to use bootstrap datepicker to disable some dates

Asked

Viewed 81 times

-1

I believe that after a certain date chosen by the user, all the dates ahead are disabled for choice, I tried the use of maxDate, but it has no effect, I was able to disable some date using disableDate but I don’t find much about how to use itlo, I end up seeing more use of maxDate that is not working for me.

i have a function that is called when the user clicks on a date q is this

limitDate() { $( "#final_date" ).datepicker({ datesDisabled: ['+m'] }); }

and where I start my datepicker is like this:

  activeDate() {
$("#initial_date").datepicker({
  changeMonth: true,
  changeYear: true,
  format: 'dd/mm/yyyy',
  startView: "days",
  minViewMode: "days",
  language: 'pt-BR'
});
$("#final_date").datepicker({
  changeMonth: true,
  changeYear: true,
  format: 'dd/mm/yyyy',
  startView: "days",
  minViewMode: "days",
  language: 'pt-BR',
  datesDisabled: this.disabledDates
});

}

Can someone help me with what I’m missing please

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.