web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[date-picker] Add support for disabled dates

Open Wnt opened this issue 6 years ago • 6 comments

I would like to prevent particular dates, e.g. Saturdays, Sundays and public holiday from being selected.

Wnt avatar Mar 15 '19 14:03 Wnt

I would like to prevent particular dates, e.g. Saturdays, Sundays and public holiday from being selected.

We are also having the exact same requirement to disable saturdays, sundays and public holidays.

ashishlahoti avatar Oct 30 '19 01:10 ashishlahoti

Acceptance Criteria: https://github.com/vaadin/platform/issues/2867

rolfsmeds avatar Mar 28 '22 12:03 rolfsmeds

Cross-posting this note I also added to the above acceptance criteria link:

This request is exactly what we need in our use of the vaadin date picker, except we have no need for the Java side of things. We use the date picker purely as a web component consumed within a LitElement. Would it be acceptable for us to develop a PR that implements a Javascript-only implementation where the is-date-available function is provided as a Javascript function that returns boolean? This is how our legacy datepicker is implemented and we're hoping to replace it with the Vaadin date picker yet keep this critical piece of functionality for disabling arbitrary dates.

ghost avatar Jan 04 '23 20:01 ghost

Two additional wishes:

It should also be possible to define tooltips for certain disabled dates, so that the user gets the info why the day is disabled, e. g. "Christmas", "New Year", "Day Of The Tentacle", etc.

And, if the dates will be defined in an eager way, it should be possible to define date ranges for better DX (e.g. to represent co-worker vacation).

stefanuebe avatar Sep 11 '23 16:09 stefanuebe

Looks like a great feature, in our case a valid delivery date can be any date determined by the user, so not the classical "Sat,Sun" or holiday schenario

esommars avatar Oct 05 '23 11:10 esommars

For our use-case it would be nice to be able to disable or hide weekends (Saturday and Sunday).

BR-blu02 avatar Apr 11 '25 09:04 BR-blu02