vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
426 stars 81 forks source link

[date-picker] Add support for disabled dates #1820

Open Wnt opened 5 years ago

Wnt commented 5 years ago

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

ashishlahoti commented 4 years ago

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.

rolfsmeds commented 2 years ago

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

ghost commented 1 year ago

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.

stefanuebe commented 9 months ago

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

esommars commented 9 months ago

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