Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to disable days per week or dates. #15

Closed
cdvillard opened this issue Sep 17, 2020 · 4 comments · Fixed by #52
Closed

Provide a way to disable days per week or dates. #15

cdvillard opened this issue Sep 17, 2020 · 4 comments · Fixed by #52
Labels
enhancement New feature or request

Comments

@cdvillard
Copy link

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)

@WickyNilliams
Copy link
Contributor

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

@WickyNilliams WickyNilliams added the enhancement New feature or request label Sep 18, 2020
@matthewmnewman
Copy link

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);

@taromorimoto
Copy link

@WickyNilliams what do you think about the suggested implementation? #52

@WickyNilliams
Copy link
Contributor

@taromorimoto see my comment on the PR. I'll try to look at it later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

4 participants