I could use some help. I am having input field with type="text"
and ng-required="true"
. I am using datepicker (Angular UI Bootstrap).
If my input is empty, someForm.someInput.$error
returns "required":true
, which is okay.
If my input is filled with "someText"
, someForm.someInput.$error
returns "date":true
, which is odd to me.
How is this triggered, is this done by directive datepicker? I don't have type="date" or something.*
How could I achieve that date in format "dd.MM.yyyy" would be valid?
If I enter 01.01.2015
or 01.13.2015
- this seems to be valid (no "date":true
) but apparently it isn't.
I guess current valid format is "yyyy.MM.dd"
.
Note: I am also using angular locale file, if this is important.
I found out that datepicker is using two values. One for model, one for input. This works if you enter date by selecting it from popup, although not working if typing it in input field.
I have solved this issue by putting readonly attribute to input field.