Closed cdvillard closed 3 years ago
We were already planning on this, but it's good to have it in the issue tracker. Thanks :)
Our plan was to allow passing a basic function isDateEnabled
(or maybe it should be isDateDisabled
?) that accepts a date as returns a boolean.
Would this fit your needs? You can have arbitrary logic that way
I agree that this is a must-have implementation.
Adding a function such as isDateDisabled would be ideal as it would add flexibility to use any arbitrary logic to disable dates.
// return true to disable
return (date.getDay() === 0 || date.getDay() === 7);
@WickyNilliams what do you think about the suggested implementation? https://github.com/duetds/date-picker/pull/52
@taromorimoto see my comment on the PR. I'll try to look at it later this week.
Is your feature request related to a problem? Please describe. Using our current date picker doesn't offer a fully disabled state, which makes this one attractive, but we need to be able to disable specific days per week and dates as well.
Describe the solution you'd like It'd be helpful to be able to select specific days of the week to disable, as well as pass in an array of dates to disable.
Describe alternatives you've considered N/A
Additional context The calendar we're currently using is flatpickr, which allows us to disable entire days from each week (i.e.: Mondays, Wednesdays, Fridays) and specific dates (i.e.: Dates that have already been booked, or closed holidays)