Closed greatgraphicdesign closed 4 years ago
I think you can set minimum date to today in the instance options when you instantiate your Datepicker.
I would love to find it; however, I'm not seeing it in the docs.
Look at this file it's the complete default options object and you will see minDate and maxDate : https://github.com/mymth/vanillajs-datepicker/blob/master/js/options/defaultOptions.js
I was able to use it by setting a minDate parameter when I instantiate my Datepicker. You'll need to set the minDate with the current date format you are passing to the Datepicker.
I somehow missed minDate. Thank you so much for following up.
I added the following option, and it works! minDate: new Date().toLocaleDateString("en-US")
@greatgraphicdesign You can use Date object too. So, minDate: new Date()
is enough to make it work. (no need to stringify)
Just FYI.
Very cool. Thank you!
@greatgraphicdesign You can use Date object too. So,
minDate: new Date()
is enough to make it work. (no need to stringify) Just FYI.
I am currently having the same issue.
Actually I've done the same thing minDate: new Date()
but it still works like "maxDate" option and it disables all the dates beginning from today and all the past dates are still remains active.
It would be really nice to be able to limit the start date so it can't be older than today. Thank you!