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

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 Get Your Blogs Posts Using Blogger API

30-07-2017 blogger api json php

How to upload file by using request module

18-03-2017 request module node js

How to use http-post request in node js

14-03-2017 http-post module node js

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Filter for insert HTML in Angular Js

06-03-2017 filter show html angular js html