Skip to content

Instantly share code, notes, and snippets.

@netstart
Last active February 28, 2023 21:16
Show Gist options
  • Save netstart/6fbde97d702cafb441067831edc771fb to your computer and use it in GitHub Desktop.
Save netstart/6fbde97d702cafb441067831edc771fb to your computer and use it in GitHub Desktop.
Forçar que o Angular utilize o locale pt-BR em uma aplicação.
// https://github.com/angular/angular-cli/issues/6683
import { NgModule, LOCALE_ID } from '@angular/core';
// force to use locale pt-BR
providers: [ {provide: LOCALE_ID, useValue: 'pt-BR' } ]
// Or use below line to get locale from browser
// providers: [ {provide: LOCALE_ID, useValue: window.navigator.language} ]
@thiagosperandio
Copy link

thiagosperandio commented Jul 25, 2018

Hi,

I had to add this too: registerLocaleData(ptBr);. See this link:

angular/angular#20197 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment