I am using the angular date picker and have set the locale to en-NZ in the app module like so.
{
provide: LOCALE_ID,
deps: [LocaleService], //some service handling global settings
useFactory: (LocaleService: { locale: string; }) => LocaleService.locale
},
I am using the shortDateFromat but angular date pipe is not formating to the correct locale.
Expected: 6/9/21
Actual: 9/6/21
It appears that it is always formatting to the en-US locale.
You can add in your app.module.ts this:
import { LOCALE_ID } from '@angular/core';
...
@NgModule({
providers: [{ provide: LOCALE_ID, useValue: 'en-nz' }],
})
It works for me.