domino-ui icon indicating copy to clipboard operation
domino-ui copied to clipboard

Make it possible to disable certain dates in datebox / datepicker

Open FrankW76 opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. People should be only allowed to pick certain dates in a datebox/datepicker.

For example

  • Only mondays and tuesdays
  • Or no weekends
  • Only first monday of each month
  • Only first day of each quarter/semester/....

Describe the solution you'd like Not sure how to implement this.

  • setValidDates(List<Date> validDates) --> user may only pick these days
  • setInvalidDates(List<Date> invalidDates) --> user may not pick these days
  • setValidWeekDay --> user may only pick these days of the week
  • .....

Describe alternatives you've considered /

Additional context /

FrankW76 avatar Mar 16 '21 13:03 FrankW76

Theres a much simpler way to white or blacklist dates, using a Predicate<Date>. The Predicate can then have any logic it wishes to allow or disallow any date based on any logic be it only allowing Mondays, only allowing the first of each month or whatever. Its not practical to require a List of ALL valid or ALL invalid, there could be 100s or 1000s or a lot more than that.

mP1 avatar Jul 24 '23 10:07 mP1