Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiDatePicker] Current year not shown on year selection if minDate is set to moment() #4219

Closed
j-m opened this issue Nov 3, 2020 · 2 comments · Fixed by #5069
Closed

[EuiDatePicker] Current year not shown on year selection if minDate is set to moment() #4219

j-m opened this issue Nov 3, 2020 · 2 comments · Fixed by #5069
Labels

Comments

@j-m
Copy link
Contributor

j-m commented Nov 3, 2020

I am using minDate={moment()} to prevent users selecting dates in the past and have no limit on future dates.
If they want to change the year and select 2021, they have no way of getting back to 2020 without going back through all the months.

With minDate={moment()}
image

Without minDate={moment()}
image

@j-m
Copy link
Contributor Author

j-m commented Dec 11, 2020

I may work on this.
Regardless of if I get around to it, the immediate question is:

Should it display 5 full rows of years (2020-2034), or stick with 7 future years (2020-2027)?

The former feels like too many (over a decade) and the latter would still leave a gap.
I've not looked at the code yet but, if possible, I would use a flex grid and set the columns to 3. Then, at the very least, the gap would be at the end. This would also allow the display to adapt for if the dev were to set a maxDate.

@cchaos

@cchaos
Copy link
Contributor

cchaos commented Dec 14, 2020

I think the simplest solution for now would be to just have the same count of years for all representations. So a full decade even thought it seems like a lot. We'll be refactoring this component next year so there will be more time to investigate options then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants