Mik378 Mik378 - 1 year ago 167
AngularJS Question

AngularJS/Angular-ui-bootstrap Changing language used by the datePicker

I use the datePicker documented here.

However, no direct option allows to change the language, English by default.

I find a the documentation of the widget provided without angular directive, and it provides a nice way to achieve it:


Is there an easy way, avoiding to tweak the original directive's source code, to change it?

Answer Source

If you are using the DatePicker form angular-ui simply add the localized js file in the header of your page. An example would be :

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js"></script>
<script src="http://code.angularjs.org/1.0.8/i18n/angular-locale_fr-fr.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script>

You can see a working plunker here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download