Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Datepicker - Date is Always Required? #3862

Closed
hancock808 opened this issue Jun 26, 2015 · 7 comments
Closed

Datepicker - Date is Always Required? #3862

hancock808 opened this issue Jun 26, 2015 · 7 comments

Comments

@hancock808
Copy link

See my Plunkr > http://plnkr.co/edit/1iGDEnnpEOtBPymPPiLS?p=preview

Dates are not required on my form, however when a date is entered then cleared out the form is marked invalid and the user cannot submit.

@wesleycho
Copy link
Contributor

This looks like a legitimate bug - this needs to be rewritten to use ngModel.$validators

@wesleycho wesleycho self-assigned this Jun 26, 2015
@nivivive
Copy link
Contributor

@wesleycho , I have a fix to this bug in my forked repo: https://github.com/blendlabs/bootstrap. Should I add tests and submit a PR for this issue?

@wesleycho
Copy link
Contributor

I am assuming that this is the commit?

Feel free to open a PR - I think this is not quite the correct way to fix this though. The proper fix would change the setting of validity to be in ngModelCtrl.$validators.date and not manually checking $attrs.ngRequired.

@nivivive
Copy link
Contributor

moving discussion to PR referenced below

@wesleycho wesleycho modified the milestones: 0.13.2 (Performance), Backlog Jul 29, 2015
@pavlovt
Copy link

pavlovt commented May 7, 2016

the bug still exists in version 1.3.2 (date is always required for uib-datepicker-popup component)

@brunosantosnasajon
Copy link

Bug still exists in version 2.0.1. Is this project still maintained?

@MatheusArleson
Copy link

Bug still happens on version 2.5.6.

I have an optional datepicker field initialized with null value.
When the datepicker is initialized, angular has a $error.date

An null date is an invalid date, but a null value for the model maybe not.

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

No branches or pull requests

6 participants