Topic: disablePat datepicker

Christian Cazzaro pro asked 1 year ago


I am trying to disable past dates of datepicker via data attributes but it's not working.

Here it's my code:

<div class="form-outline datepicker" data-mdb-toggle-button="false">
              <input type="text" class="form-control" id="exampleDatepicker13" data-mdb-toggle="datepicker" data-mdb-disablePast="false"/>
              <label for="exampleDatepicker13" class="form-label">Check-in</label>

Could you please help? Maybe I am doing something wrong?

Thank you

Kamila Pieńkowska staff answered 1 year ago

When you declare via HTML you need to change Camelcase to lower case with a dash. Also, you need to set the value of the data attribute to true. Example snippet:

Christian Cazzaro pro commented 1 year ago

It didn't work until I found out I had the 4.2.0 version of the package. Updated it to 4.3.0 and now it's working

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 4.3.0
  • Device: MacBook Pro
  • Browser: Chrome
  • OS: iOS
  • Provided sample code: No
  • Provided link: No