I'm working on i18n in Angular 8 app. I have registered locale Hindi ('hi') using following code inside app.module.ts
.
import { registerLocaleData } from '@angular/common';
import localeHi from '@angular/common/locales/hi';
import localeHiExtra from '@angular/common/locales/extra/hi';
registerLocaleData(localeHi, 'hi', localeHiExtra);
It changed the digits and month text inside which is as expected. But, when I use DatePipe
on date inside a template, it just converted month name to Devanagari and didn't converted digits of date. Same is happening with DecimalPipe
.
I even tried to specify locale manually to these pipes, but it didn't work. Why is it behaving differently with <mat-datepicker>
and DatePipe
? I'm doing something wrong or is it intended behaviour? Any help would be appreciated!