Skip to content

Commit

Permalink
Changes filter name to timeify because it covers more than seconds now.
Browse files Browse the repository at this point in the history
Handles the complete conversion from millisecond timestamp to
minute:second form
  • Loading branch information
camilopayan committed Jul 1, 2015
1 parent 9df47f7 commit ec45048
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ var app = angular.module("FirePom", [])


// Seconds to Minutes:Seconds filter
.filter('secondsToString',
.filter('timeify',
function() {
return function(input){
var s = input % 60;
return Math.floor(input/60) + ':' + ( s < 10 ? ('0'+s) : s );
var time = input/1000;
m = time / 60;
s = time % 60;
return Math.floor(m) + ':' + ( s < 10 ? ('0'+s) : s );
};
}
);

0 comments on commit ec45048

Please sign in to comment.