AngularJS Tutorial - Filter value with mediumDate








The following code shows how to filter value with mediumDate.

Example


<!DOCTYPE html>
<html  ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<!--from   w  w w.  j  a va2 s.co m-->
<script type='text/javascript'>
angular.module('myApp', ['ui.bootstrap']);
function Ctrl($scope) {
     $scope.mytime = "1374030547000";
}
</script>


</head>
<body>
  <body ng-app="myApp">
<div ng-controller="Ctrl">
    {{ mytime | date: 'mediumDate' }}
</div>
</body>
</body>
</html>

The code above is rendered as follows: