-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Datepicker binding fails with custom format and ng-required #4607
Comments
@Neilski, please do not use the issues forum for support related requests. Rather, please follow the instructions here. If you think you've found a bug, please follow these instructions. Unfortunately, if you think you have found a bug and do not follow the above instructions within a reasonable amount of time, we will close the issue due to lack of activity. |
Apologies. I have now added the Plunker example at http://plnkr.co/edit/uwAzMAEzhxKMaSKHYu5P I hope this helps define the problem. |
No worries. This needs more investigation, but in the interim, it works correctly if you just add |
Ahhhh. After some research, you're not using the Closing as this is working as designed. |
I have just re-tested my test case using required instead of ng-required and I am still seeing the same problem with the date value being nulled. |
I'll post the working plunker when I get into work. Please ping me if I forget. |
Ok, you neglected to say that the issue is when you assign an initial value to the model and I'm reopening for more investigation. |
I'm not sure if this is the same issue but I have a similar example here So far, I have seen this issue only when format is provided with uib-datepicker-popup and it also includes a ngRequired expression. As you can see in the plnkr, the date field disappears from the model. So, the snippet will work properly if you remove One more observation was that this affects all other datepickers on the page whether or not they have the format and ngRequired combination. |
@codenewa, please open a new issue following our instructions if you feel this is a bug and needs fixing. Adding to an already closed issue is almost a sure-fire way for it to get missed/lost. Thanks. |
If the datepicker is defined with a custom date format (e.g. 'dd/MM/yyyy') and is marked with the ng-required attribute, the model binding fails and sets the target model date to null. For example:
A simple example of this problem can be found at http://plnkr.co/edit/uwAzMAEzhxKMaSKHYu5P
The code uses...
The text was updated successfully, but these errors were encountered: