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

Add a way to have max constraint applying only on the end month picker of a range #48

Open
benjamindulau opened this issue Sep 26, 2019 · 2 comments

Comments

@benjamindulau
Copy link

In some cases the range component is pretty inconvenient.

The problem occurs when you have the min/max constraint being dependent of the first month you select (from).

The use case is:

"We want to force the user to select maximum 1 year ahead"

  • The user selects the start month (from): say january 2018
  • The code then dynamically updates the max constraint to the selected month + 1 year (to December 2018)
  • The user selects the end month (to): say December 2018
  • The picker closes and at this point everything is ok
  • The input now shows January 2018 > December 2018

Now the user wants to select another range in the future (2019):

  • The user reopens the picker
  • The picker has the previous value preselected (Jan 2018 > Dec. 2018)
  • The user wants to select a month in 2019 as the start month

That's when this is inconvenient. Since the max is currently December 2018 and is applying to both start and end, the user can't move forward the year on the start month. He needs to first change the year on the end month picker, and then move the start month picker.

I guess being able to choose whether the max constraint is applying on both start and end or only on end would simply fix this.

What do you think?

@nickeljew
Copy link
Owner

sorry for the late late response, and I will try to find a proper way to meet your need soon, if you still want it :)

@nickeljew
Copy link
Owner

update in v2.2.0. please check the new feature with brand new property "autoRange"

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