i am using bootstrap-datepicker.js to take date of birth from calendar,i need to disabled past date and it should be enabled after 18 years in calendar. Please help me to resolved this issue.
Asked
Active
Viewed 1,349 times
-6
-
1Use moment.js it has all the functionality required by you! – Ullas Hunka Jun 07 '18 at 13:45
-
3Your code is the bootstrap-datepicker plugin...? Please show us the code you wrote to attempt to solve this. – Rory McCrossan Jun 07 '18 at 13:46
-
1No one wants to read that wall of code and guess what your error might be. Please read [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and more importantly, please include a [minimal, verifyable and complete example](https://stackoverflow.com/help/mcve). – Thomas Flinkow Jun 07 '18 at 14:00
2 Answers
0
Could try initialising it with the max date attribute set
$("#datePickerId").datepicker({
maxDate: "-18Y"
});

iainc123
- 56
- 1
- 5