Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

479
Visualizações
Angular 4 / Angular-cli: Date Polyfill with Internationalization API does not work

I can not seem to get the polyfill of the Internationalization API to work. As stated in the docs (https://angular.io/docs/ts/latest/guide/pipes.html) one simply needs to add a script to your index.html:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.de"></script> 

And all issues with wrong displayed date pipes should be gone. However this problem still persists.

On another webpage (https://coryrylan.com/blog/adding-the-internationalization-polyfill-to-a-angular-cli-project), I found a more favored solution of installing Internationalization API and adding it to polyfills.ts in angular src folder.

One should npm run install intl --save and then import the intl polyfill like import 'intl'; import 'intl/locale-data/jsonp/de.js'; but this also doesnt work.

Has anyone had success with adding the date polyfill to Angular 4 ?

Some suggested using a custom pipe from moment.js but this can not be a solution for me (Angular2 date pipe does not work in IE 11 and edge 13/14), as such a powerfull beast like angular should provide such a functionality. Maybe I did something wrong?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can not freely use angulars datePipe to format dates. Like this: | date: 'HH:mm' this works in chrome but not in edge to display: 08:15. You can use Angular's 'shortTime' pipe for this.

EDIT 08.05.2017: Anybody still facing issues with InternationalizationAPI in Safari: Make sure you pass a date like {{"2016-07-03T12:33Z" | date 'dd.MM.yyyy'}}, so you need an ISO string representation of it for it to work (only needed in safari), thanks apple.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda