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

[Proposal] Use isEmpty for the date validator's allowBlank alike the other validators #317

Open
frykten opened this issue Oct 14, 2021 · 0 comments

Comments

@frykten
Copy link

frykten commented Oct 14, 2021

Heya!

I tried to follow the discussion from which birthed the current date validator, but I couldn't find an answer: why do you not allow empty strings '' in this validator? The other validators from this addon do so; ember-validators, from where this addon takes a lot, do so (cf.).

Was there a reason? Maybe it's due to moment.js?

I see you added that in the tests as invalid cases; meanwhile all the other validators have the empty string as, at minima, the only "blank" value. Shouldn't we here base the "blank" check on either the isEmpty() or isBlank() Ember's utils' methods (just as ember-validators, which is used for this addon's number validator)?

To have the same behaviour for such options on all validators would ease the use of the API, I think.

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

1 participant