How do I convert date from mm-dd-yyyy to mm/dd/yyyy in AngularJS. Here is the plunker http://plnkr.co/edit/uoeuuHD8GOkPxj5LOlE5?p=preview
$scope.date = '07-28-2016';
{{ data | date:'filter'}} //should return 07/28/2016
First, start with an actual Date
instance
$scope.date = new Date('2016-07-28'); // ISO 8601 date formats are less ambiguous
then use the date
filter, ie
{{ date | date: 'MM/dd/yyyy' }}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.