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:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

How to redirect one page to another page in php

20-03-2017 redirect php

How to upload file by using request module

18-03-2017 request module node js

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Sample Validations in javascript

22-02-2017 validations javascript