Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override default datepicker locale #2521

Open
maxokorokov opened this issue Jul 12, 2018 · 0 comments
Open

Override default datepicker locale #2521

maxokorokov opened this issue Jul 12, 2018 · 0 comments

Comments

@maxokorokov
Copy link
Member

It looks like it's not possible to override the datepicker locale on a per-datepicker / component basis, but only at the app level:

  • we @Inject(LOCALE_ID) private _locale in the NgbDatepickerI18nDefault
  • we have only one instance of the i18n service in the NgbDatepickerModule : {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nDefault}

Note that NgbDatepickerI18nDefault is private.

So we probably should move {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nDefault} to the datepicker component instead of the module, so you could override locale anywhere.

However, in this case we should inject NGB_DATEPICKER_LOCALE_ID that will use LOCALE_ID by default not to interfere with the rest of the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant