Filter for change Date format (MM-dd-yyyy) in Angular Js

mm-dd-yyyy
date formats
angular js

By using below filter for change Date format (MM-dd-yyyy) in Angular Js, for given date.
Ex : 2017-03-05 08:40:00. By using the below filter the final result is 03-05-2017

angular.module('test').
filter('ChangeDateFormat', function($filter)
{
	return function(input)
	{
		if(input == null){ return ""; }
		var _date = $filter('date')(new Date(input), 'MM-dd-yyyy');
		return _date;
	};
});

 

 

You might also like:

Use java script file client side and server side at a time in node js

30-07-2017 node js include call javascript

How to get id by using name attribute in javascript

20-03-2017 html id name javascript

How to make an http request in node js

14-03-2017 http module node js

How to get current date and time (yyyy-mm-dd H:i:s) using javascript

09-03-2017 javascript date time

Get Unique values from array/object in javascript

19-02-2017 javascript unique remove repeated values from array