Created
July 31, 2014 22:27
Revisions
-
Spittal renamed this gist
Jul 31, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Spittal revised this gist
Jul 31, 2014 . No changes.There are no files selected for viewing
-
Spittal created this gist
Jul 31, 2014 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ .filter('formatTime', function() { return function(milliseconds,withHour) { var seconds = parseInt((milliseconds/1000)%60); var minutes = parseInt((milliseconds/(1000*60))%60); var hours = parseInt((milliseconds/(1000*60*60))%24); var out = ""; minutes = (parseInt(minutes) + (60 * parseInt(hours))); minutes = (minutes < 10) ? "0" + minutes : minutes; seconds = (seconds < 10) ? "0" + seconds : seconds; out = minutes + ":" + seconds; if(withHour) { hours = (hours < 10) ? "0" + hours : hours; minutes = (minutes < 10) ? "0" + minutes : minutes; seconds = (seconds < 10) ? "0" + seconds : seconds; out = hours + ":" + minutes + ":" + seconds; } return out; }; });