Created
November 23, 2016 03:28
-
-
Save JulesAU/0af8474266f161e53b69076e45384052 to your computer and use it in GitHub Desktop.
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 characters
/* render HH:mm from a time delta */ | |
function renderMinutesSeconds(ts, now) { | |
var seconds = Math.round(now - ts); | |
var minutes = Math.floor(seconds / 60); | |
seconds = (seconds % 60); | |
return String("0" + minutes).slice(-2) + ":" + String("0" + seconds).slice(-2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment