Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to translate date in spanish?

I need to convert this date: 1443729984884

in this date: 01 octubre 2015 22:06

Is there a way to do this with the filters in angular ?

like image 441
xRobot Avatar asked Jan 29 '26 14:01

xRobot


1 Answers

Angular supports i18n Standard for location | globalization | internationalization. When it comes to number or date formatting Angular relies on $locale service. Here is the list of locations currently supported by angular:

http://cdnjs.com/libraries/angular-i18n/

Here is an example on how to support spanish locale:

Online Demo

<html ng-app>
 <head>

   <script src="angular.js"></script>
   <script src="i18n/angular-locale_es-es.js"></script>

 </head>
 <body >
     <span ng-non-bindable>{{1443729984884 | date:'dd MMMM yyyy hh:mm'}}</span>:
     <span>{{1443729984884 | date:'dd MMMM yyyy hh:mm'}}</span><br>
</body>
</html>
like image 65
Dalorzo Avatar answered Jan 31 '26 02:01

Dalorzo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!