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

DatePicker: When yearRange is specified with descending array, month selection is broken. #492

Open
entioentio opened this issue Mar 18, 2020 · 3 comments

Comments

@entioentio
Copy link
Contributor

From UX point of view years should be sorted descending for some cases, for example for choosing date of birth. You want to give people in thier 20s more prio than people in their 90s.

Fixing in #491

@JosephusPaye
Copy link
Owner

Thanks for the PR!

What sort of error do you have when the year range is descending? Does the rendering fail?

@entioentio
Copy link
Contributor Author

You can't select months because this check fails:
const outsideYearRange = firstDayOfNextMonth.getFullYear() > sortedYearRange[sortedYearRange.length - 1];.

Previous array element is bigger then the current, so it is always "outsideYearRange".

@JosephusPaye
Copy link
Owner

JosephusPaye commented Mar 18, 2020

Ah, I see.

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

No branches or pull requests

2 participants