0
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?

None
  • 8,817
  • 26
  • 96
  • 171

2 Answers2

0

Hi can you look at this post

set locale in datepipe

i think the above post working fine,can you check that

Robert
  • 3,373
  • 1
  • 18
  • 34
0

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);
 }

This for "bs-BA"

This for "en-US"

Robert
  • 3,373
  • 1
  • 18
  • 34