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

Invalid Date and Model on datepicker-popup #1230

Closed
akab opened this issue Jan 19, 2017 · 3 comments
Closed

Invalid Date and Model on datepicker-popup #1230

akab opened this issue Jan 19, 2017 · 3 comments

Comments

@akab
Copy link

akab commented Jan 19, 2017

versions: Angular2, Bootstrap4, ng-bootstrap1.0(alpha18)
Hi,
I'm currently using the datepicker in my project and I've discovered the following two issues regarding the date inserted in the input box and the model saved.
The plunker the is the one in the datepicker docs:
https://ng-bootstrap.github.io/app/components/datepicker/demos/popup/plnkr.html

1. There is no validation on the inserted date, as demonstrated also in the following screenshot
screen shot 2017-01-19 at 14 30 21

2. When the number of digits of the inserted day/month/day exceeds its limit the number is castrated to the last two digits, but the model is saved anyway:
screen shot 2017-01-19 at 14 40 26
Not only, once the year is "broken" the only way to reset the date correctly is to clear the input field.
I'm aware of maxDate input, but has you can see from the picture the year exceeds the default value of 10 year from now.

Please let me know,
Thank you in advance

@pkozlowski-opensource
Copy link
Member

This is similar to #1222 and #1225 - the 2 mentioned issues are touching the validation story. The good news is that we are just working on proper validation support in a datepicker.

I'm going to keep this issue open so the mentioned use-cases are part of the default validators.

@akab
Copy link
Author

akab commented Jan 19, 2017

ok, thank you!

@pkozlowski-opensource
Copy link
Member

For anyone tracking this issue, here is a design doc for the validation of datepickers: https://docs.google.com/document/d/1NmyKQjpmva62-Y8A-nfzJjD3p09fb-Q-UtS39HzFjTo/edit?usp=sharing

Feel free to comment / provide your input.

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

No branches or pull requests

2 participants