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

05-03-2017 mm-dd-yyyy HH:MM date formats angular js

Angular.js has a built-in date filter. But as per our requirements we can use filers to change date formats 

angular.module('surgi').
filter('ChangeTimeFormat', function($filter)
{
	return function(input)
	{
		if(input == null){ return ""; }
		var _date = $filter('date')(new Date(input), 'HH:mm');
		return _date;
	};
});

This filter load in your js file. This filter calls from html. Here is the sample code to call the filter

<p>{{dt | ChangeTimeFormat}}<p>

 

 

 

 

You might also like:

How to use request module in node js
16-03-2017 request module node js
Sanitization in java sript
14-03-2017 sanitization java script
Remove last two characters from given string using slice
07-03-2017 slice remove
Filter for change Date format (MM-dd-yyyy HH:mm) in Angular Js
05-03-2017 mm-dd-yyyy HH:MM date formats angular js
How to change background color and color to the text using javascript
27-02-2017 css javascript colors