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

Datepicker dynamic localization issue #4286

Closed
popovd opened this issue Aug 27, 2015 · 3 comments
Closed

Datepicker dynamic localization issue #4286

popovd opened this issue Aug 27, 2015 · 3 comments

Comments

@popovd
Copy link

popovd commented Aug 27, 2015

Hello,

I have a problem with the inline datepicker not refreshing it's display template on dynamic locale change. More specifically it does not update the days and months labels. I've looked at the ui-bootstrap-tpls.js code and found that the templates have been updated to use the one-time binding (probably for performance reasons) since version 0.13.1. While this decision is certainly by design it causes the developers of applications, supporting on the fly change of locale, to look for workarounds to trick the datepicker control to re-render.

An example of the old (working) behavior can be found here: http://plnkr.co/edit/7LsfG5D28Y7jB9vhEiQV?p=preview
An example of the current (not working) behavior can be found here: http://plnkr.co/edit/qAmjLbEMVAOyFyoRp6qH?p=preview

The module that I use to change the locale dynamically is angular-dynamic-locale (https://github.com/lgalfaso/angular-dynamic-locale). Essentially what it does is replace the $locale object.

Is there an option to revert to the normal binding for the labels in the day.html and month.html?

Best Regards,
Deian

@RobWright
Copy link

Just like to add that I am also having this issue.

@alvipeo
Copy link

alvipeo commented Sep 16, 2015

I need this to be fixed too. Anyone know workaround?

@popovd
Copy link
Author

popovd commented Sep 16, 2015

Hi,

The workaround is to modify the templates of interest in the ui-bootstrap-tpls.js by removing the :: binding where necessary.

Regards,
Deian

@wesleycho wesleycho added this to the 0.14.0 (Bootstrap 3.3) milestone Sep 17, 2015
jasonaden pushed a commit to deskfed/bootstrap that referenced this issue Jan 8, 2016
- Reset parsers when $locale.id changes to take into account changed
  localization settings

Closes angular-ui#4286
Closes angular-ui#4425
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

4 participants