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

Feature Request: Date (Range) Pickers | Add prop(s) to easily enable/disable dates and weekdays #184

Open
ds-clearago opened this issue Dec 18, 2023 · 2 comments

Comments

@ds-clearago
Copy link

So that holidays and weekends can be disabled etc.) not only maxValue/minValue

If on top of that certain weekdays can be disabled in general, that would be great (we almost never need Saturdays and Sundays to be selectable)

See

@Pagebakers
Copy link
Contributor

I'm not sure yet if I'm in favor of adding properties for all these specific use cases, but it's actually already possible to achieve the same with the isDateUnavailable property.

Adding more docs and perhaps some helpers could be a great start. Something like this for example:

const daysOfWeekUnavailable = (date, days) => {
  return days.includes(date.toDate().getDay())
}
const isDateUnavailable = (date) =>
    return daysOfWeekUnavailable(date, [0, 6])
)

<DatePicker isDateUnavailable={isDateUnavailable} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants