saas-ui
saas-ui copied to clipboard
Feature Request: Date (Range) Pickers | Add prop(s) to easily enable/disable dates and weekdays
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
- https://ant.design/components/date-picker#components-date-picker-demo-disabled-date
- https://uxsolutions.github.io/bootstrap-datepicker/
datesDisabled+daysOfWeekDisabled -
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} />