Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular calendar how to change language

Tags:

angular

I'm working with angular calendar, by default the language is english, i want to change it to spanish.

My issue is that the documentation is poor, even the stackblitz example only works with french, if i try with spanish code (es), or any other language code, the calendar doesn't show nothing at all.

How i can change the names of the days & months properly with angular calendar?

like image 370
Progs Avatar asked Aug 22 '18 17:08

Progs


1 Answers

The repo's changelog explains that if you want to use a "locale other than english you will need to import the appropriate locale data".

In this case:

import { registerLocaleData } from '@angular/common';
import localeEs from '@angular/common/locales/es';

registerLocaleData(localeEs);

See this StackBlitz.

like image 97
nick Avatar answered Sep 21 '22 18:09

nick