JosephusPaye / Keen-UI

A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.
https://josephuspaye.github.io/Keen-UI/
MIT License
4.1k stars 438 forks source link

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

Open entioentio opened 4 years ago

entioentio commented 4 years ago

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 commented 4 years ago

Thanks for the PR!

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

entioentio commented 4 years ago

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 commented 4 years ago

Ah, I see.