vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

`Datepicker` component to be able to select just Months or Year #6659

Closed Alexenon closed 3 hours ago

Alexenon commented 3 hours ago

Proposed Features:

Month Picker Mode:

A mode where the DatePicker component only allows the user to select a month and year (ignoring the specific day).

Year Picker Mode:

A mode where the DatePicker allows users to select just a year.

There is already such question on Vaadin Forums, but there is no good answer for this.

Describe the solution you'd like

I know that there is a way to achieve this, by using native HTML component, but I'd like to have a vaadin component with the same functionality.

<input type="month" id="start" name="start" min="2018-03" value="2018-05" />

I don't know which exact Java API is the best. Examples:

Describe alternatives you've considered

No response

Additional context

Any workarounds will be great too 🗡️

web-padawan commented 3 hours ago

Duplicate of https://github.com/vaadin/web-components/issues/1865. Please see the discussion in that issue.