Ability to set language on App or controller
I don't think setting language="**" in the template for every datepicker is a good thing. Can we overwrite the language setting on App level or in a controller. Maybe use it with a queryparam. Perhaps this functionality is already in but undocumented?
This is a pretty nice idea! :+1: I didn't have more than one datepicker on the template before, but could imagine that it would be nice to configure language on the app level.
You can set default language and format for App in custom initializer, e.g.
// app/initializers/bootstrap-datepicker.js
export function initialize() {
$.fn.datepicker.defaults.format = 'dd.mm.yyyy';
$.fn.datepicker.defaults.language = 'de';
}
export default {
name: 'bootstrap-datepicker',
initialize: initialize
};
@soulim If you are OK with this approach for setting global defaults, I can open a PR adding this to documentation...
@jesenko I like it :+1: