Date value filter

Description

The following code shows how to use date value filter.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script type='text/javascript'>
function MyCtrl($scope) {<!--from   w ww. java  2  s.c o m-->
    $scope.date = new Date();
}
</script>
</head>
<body>
  <div ng-app ng-controller="MyCtrl">
    {{date | date:'dd MMM yyyy - hh:mm a'}}<br />
    {{date | date:'EEEE - hh:mm '}}<br />
    {{date}}    
</div>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities