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

[Feature request] Ignore whitespace around separator on manual range input #416

Closed
doits opened this issue Jan 16, 2020 · 7 comments
Closed
Labels

Comments

@doits
Copy link

doits commented Jan 16, 2020

What problem does this feature solve?

If I have a range-input with separator <space>~<space> (like the default), I can manually enter the range with the keyboard exactly like this:

2015-12-12 ~ 2016-12-31

When I omit the spaces on manual input though, it does not work, for example like this:

2015-12-12~2016-12-31

Or if I add multiple spaces by accident:

2015-12-12 ~   2016-12-31

It would be nice if the spaces around the range separator do not have any impact when the user enters values manually, because users sometimes type like this.

@mengxiong10
Copy link
Owner

OK, This is a good improvement.

@mengxiong10
Copy link
Owner

v3.4.0 added it.

@doits
Copy link
Author

doits commented Mar 6, 2020

Thank you for implementing it! I will test it out as soon as I can, thank you!

I looked at the commit though and I am wondering if there might be a problem now with - separator? Eg. if the separator is -, can it parse 2020-02-02 - 2020-03-03 or will it split on each - and then fail?

I think before this feature if separator <space>-<space> was used, this was no problem because the spaces were taken into account. Or am I wrong?

@mengxiong10
Copy link
Owner

@doits thanks for feedback, It's bug. I need to fix it soon.

@mengxiong10
Copy link
Owner

I released v3.4.1 to fix the bug

@doits
Copy link
Author

doits commented Mar 6, 2020

👍 good job, really fast fix. Now <space>-<space> should work again, which some people might use.

I still think though that the separator - (without spaces) does not work if the user enters 2020-02-02 - 2020-03-03 or even 2020-02-02-2020-03-03 (but this maybe makes no sense to enter it like this).

And on the other hand even if separator is <space>-<space>, if the user enters 2020-02-02- 2020-03-03 (no or only spaces on one side) it will break, too.

Maybe this feature is more complicated than it looked like at first, at least if the separator can be part of the date with all this edge cases ... sorry for the work you have with it!

@mengxiong10
Copy link
Owner

Yes, this feature is complicated now.
It may be improved in the future. Using 2 input element or other parsing methods

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

No branches or pull requests

2 participants