-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Datepicker and Timepicker use $modelValue instead of $viewValue. #2069
Comments
+1 |
I tried the following fix on the render method "TimepickerController" and worked like a charm.
My fork with the fix is here https://github.com/cleftheris/bootstrap/blob/master/src/timepicker/timepicker.js |
+1 |
Will this be implemented in any future versions of ui-boostrap? We just ran into this issue as well and I noticed the problem before seeing this forum. |
+1 |
1 similar comment
+1 |
Hi @cleftheris - Can you submit a PR with an accompanying test for your change? |
Hi @karianna I will try to make a PR as soon as possible. Will post an update soon |
Do we know if this will be fixed in an upcoming version? |
This commit should have fixed it: 5f9afe5 regrads |
@antoinepairet this is not completely compatible with angular version 1.3.x.
and here is the plunker demonstrating the problem. We should always use the $viewValue inside the render method (check the assignment of scope.date). This fixes the problem.
Thanks |
Is this possibly related to #3159? It seems we have a lot of issues that may be because dateParser is not supporting everything in dateFilter. |
I think not. This is just a matter of whether we are using the |
I see - this was addressed in the datepicker recently, if there is a PR for doing the same for the timepicker, then I will gladly look at it. If not, I might take a stab at it this week. |
👍 same issue here. A new release would be great |
- Remove direct calls to $render - Remove extra call to $render during intialization (only run when format is changed) - Save last date value in formatter - Remove use of ngModel.$modelValue as users may add parsers to convert $modelValue to other formats Relates to angular-ui#2069 Fixes angular-ui#3349
- Separate validation from parsing so that validation still runs on model change - Remove direct calls to $render - Remove extra call to $render during intialization (only run when format is changed) - Save last date value in formatter - Remove use of ngModel.$modelValue as users may add parsers to convert $modelValue to other formats Relates to angular-ui#2069 Fixes angular-ui#3349
Verified that #3494 fixes @cleftheris 's issue / use case. |
- Separate validation from parsing so that validation still runs on model change - Remove direct calls to $render - Remove extra call to $render during intialization (only run when format is changed) - Save last date value in formatter - Remove use of ngModel.$modelValue as users may add parsers to convert $modelValue to other formats Relates to angular-ui#2069 Fixes angular-ui#3349
@chrisirhc looks good! |
I think this can be closed now. |
It seems that all angular controls use $viewValue in the $render function, so we are able to convert model value(using $formatters) before displaying.
The text was updated successfully, but these errors were encountered: