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

Year 0000 marked as valid in Datepicker #2721

Closed
dzagaduroska opened this issue Sep 18, 2018 · 2 comments
Closed

Year 0000 marked as valid in Datepicker #2721

dzagaduroska opened this issue Sep 18, 2018 · 2 comments

Comments

@dzagaduroska
Copy link

Bug description:
In the popup Datepicker a date string in which the year is 0000 is marked as valid. The value of the ngModel is null, but the status is "VALID" which is confusing. In my opinion these dates should be marked as "INVALID".
E.g 0000-04-09

Link to plunker: http://plnkr.co/edit/4dTDk1?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 6.1.3

ng-bootstrap: 3.2.0

Bootstrap: 4.0.0-alpha.6

@dzagaduroska dzagaduroska changed the title Year 0000 considered as valid in Datepicker Year 0000 marked as valid in Datepicker Sep 18, 2018
@pkozlowski-opensource
Copy link
Member

In the popup Datepicker a date string in which the year is 0000 is marked as valid. The value of the ngModel is null, but the status is "VALID" which is confusing.

We should investigate this. If the model is null than it should only denote an empty value (and in this case a control can be valid if it is not marked as required). But yes, we should be marking control as invalid if 0000 is entered.

In my opinion these dates should be marked as "INVALID". E.g 0000-04-09

True, we should probably exclude year 0 in the Gregorian calendar: https://en.wikipedia.org/wiki/Year_zero

@pkozlowski-opensource pkozlowski-opensource added this to the 3.2.1 milestone Sep 19, 2018
@dzagaduroska
Copy link
Author

Thanks :)

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

4 participants