themesberg / flowbite-datepicker

A Tailwind CSS datepicker built with vanilla JavaScript
https://flowbite.com/docs/components/datepicker/
MIT License
136 stars 40 forks source link

Can't we define a start date for the calendar #13

Open harshuchilzy opened 1 year ago

harshuchilzy commented 1 year ago

I want to prevent users selecting the old dates. Does this have such a feature?

Nordok commented 1 year ago

Hey @harshuchilzy ! I also need such functionality and I've investigated that this component based on the https://github.com/mymth/vanillajs-datepicker

So, you can check documentation of this library, there are two options: minDate and maxDate that can help https://mymth.github.io/vanillajs-datepicker/#/options?id=maxdate https://mymth.github.io/vanillajs-datepicker/#/options?id=mindate

Also, there are a lot of other options not described in the flowbite datepicker, but might be useful

spaquet commented 1 year ago

I tried using minDate with a date formatted as mm/dd/yyyy as this seems to be the format used everywhere else in this plugin, but so far... no results

I tried data-minDate, datepicker-minDate and minDate

Any idea how this should be called as part of the datepicker (not range)

cmer commented 9 months ago

Would like to know how to set a min/max date as well!