providers: [ { provide: LOCALE_ID, useValue: "bs-BA" }]
I'm trying to add this to get month name in bosnian but is not working. Any suggestion?
Hi can you look at this post
i think the above post working fine,can you check that
in your module module
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LOCALE_ID } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
providers: [
{ provide: LOCALE_ID, useValue: 'bs-BA' },
],
})
export class AppModule { }
in your component
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
{{date | date: 'd MMMM y'}}
`
})
export class AppComponent {
date = new Date(1988, 2, 15);
}