Date Picker min date not working


Topic: Date Picker min date not working

jgravois pro asked 9 years ago

I am creating a Date of Birth field and obviously can't have the datepicker only go back to 2009. I read the docs and tried the documented solution to no avail. I have tried both
$('.datepicker').pickadate({
     min: [1950,1,1],
     format: 'mm/dd/yyyy',
     formatSubmit: 'mm/dd/yyyy'
 });
and
$('.datepicker').pickadate({
    min: new Date(1950,1,1),
    format: 'mm/dd/yyyy',
    formatSubmit: 'mm/dd/yyyy'
});

Michal Szymanski staff pro premium priority answered 9 years ago

What version of MDB do you use? Try also this:
$('.datepicker').pickadate({
        selectMonths: true, // Creates a dropdown to control month
        selectYears: 50, // Creates a dropdown of 50 years to control year
        min: [1950,0,1]
    });

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No