From ec45048cf2ec19d85bf3b5c9a2dad9aa4a3deb97 Mon Sep 17 00:00:00 2001 From: Camilo Payan Date: Wed, 1 Jul 2015 11:25:09 -0400 Subject: [PATCH] Changes filter name to timeify because it covers more than seconds now. Handles the complete conversion from millisecond timestamp to minute:second form --- js/app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/app.js b/js/app.js index 4e837bb..919f2a4 100644 --- a/js/app.js +++ b/js/app.js @@ -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 ); }; } );