Created
July 9, 2013 20:06
-
-
Save edinella/5960784 to your computer and use it in GitHub Desktop.
Aplica o filtro 'date' do angular mesmo que a entrada seja uma string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {{ 'October 13, 1975 11:13:00' | toDate }} | |
* {{ 'October 13, 1975 11:13:00' | toDate:'yyyy-MM-ddTHH:mm:ss.SSSZ' }} | |
*/ | |
.filter('toDate', function ($filter) { | |
return function(input, format) { | |
format = format || 'medium'; | |
return $filter('date')(new Date(input), format); | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment