I'm trying to set a minDate for a jquery datepicker. but itz is not working.
$('.datepicker').datepicker({
autoclose: true,
todayHighlight: true,
format: "dd-mm-yyyy",
minDate: new Date(),
clearBtn: true,
multidate: false,
multidateSeparator: ",",
toggleActive: true
});
For jquery datepicker use:
$(".datepicker").datepicker({
minDate: 0
});
For Bootstrap versions use:
$(".datepicker").datepicker({
startDate: new Date()
});
In newer bootstrap datepicker version use below method
limiting end date **eg** +1d, +3m, +5y , -1d , -3m, -5y
limiting start date **eg** +1d, -23d, +3m ,2y, -2y
$('#dob').datepicker({
fautoclose: true,
startDate: '+1y',
});
$('#dob').datepicker({
fautoclose: true,
endDate: '-18y',
});
to disable past dates use startDate instead of minDate. like this...
$('#checkinDate').datepicker({
format: "dd/mm/yyyy",
autoclose: true,
startDate: new Date()
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With