In my Angular 8 app, I can't manage to display date fields in a localized form. I'd like to come up with something like the following:
- in English : "February 18, 2020 12:15:50"
- in French : "18 février 2020, 12:15:50"
I guess I should use Angular's DatePipe
:
{{ myDate | date }}
For all other localization purposes, I am using ngx-translate
(not Angular i18n
). It gives me access to the current language (the user can switch language on the fly), but I don't know how I can link TranslateService#currentLang
with the language used in the DatePipe
. Is there a way to do so in a simple way?