I have a pipe that I receive in the following way:
Jan 6, 2022, 11:00 AM
But I want to translate it to Spanish
Jan 6, 2022, 11:00 AM
How can I do this in angular?
<h4 class="whiteText">{{date | date:'MMM d, y, h:mm a'}} </h4>
I have a pipe that I receive in the following way:
Jan 6, 2022, 11:00 AM
But I want to translate it to Spanish
Jan 6, 2022, 11:00 AM
How can I do this in angular?
<h4 class="whiteText">{{date | date:'MMM d, y, h:mm a'}} </h4>
To change the default language
date
of the Angular pipe you need to tell it which "locale" to use. Specifically you must add these lines (usually in your classAppModule
):And with this, all your pipes
date
will be in Spanish