Angularjs is designed to overcome the lack of HTML in building applications. HTML is a good declarative language for static text presentation, but it is weak to build a Web application. So I did some work (you can also think of it as a gimmick) to get the browser to do what I want.
Angularjs date format has two forms, one is in the HTML page, one is in the JS code, are used to Angularjs filter $filter.
Html:date_expression is the date type variable you set up in $scope (note that it must be date object to be correct), and also to be displayed, | is the split symbol, the first argument after the split symbol date is the filter type that indicates the filter date. , the second parameter format is what you want to format in your date, such as YYYY-MM-DD, the last timezone is the time zone (optional parameter), for the internationalization of the site is more appropriate.
{{date_expression | date:format:timezone}}
Two ways: You can use the {{}} expression, or you can use Ng-bind or Ng-model
{{mydate | date: ' Medium '}}
code as follows:
var myjsdate= $filter (' Date ') ($scope. MyDate, ' yyyy-mm-dd ');
So the variable myjsdate you declare will get the value of MyDate formatted in $scope.
The above content is small make up for everyone to share the Angularjs date format of all the narrative, I hope you like.