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:

How to insert bulk information into database in single query execution

18-03-2017 insert sql bulk database

How to make an http request in node js

14-03-2017 http module node js

Get previous date from given date in javascript

06-03-2017 date javascript previous date

Get next date from given date in javascript

06-03-2017 date javascript next date

Send Mail in Node Js

21-02-2017 node js mail npm module