Created
October 15, 2014 08:55
-
-
Save BenWard/7f47ee00da22dd52ff09 to your computer and use it in GitHub Desktop.
Dirty little hack script to make the Creek.FM time-stamp field update live, to make it easier to post tracks at the right time.
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
(function realTimeTrackTime () { | |
function padNumber (i) { | |
i = "" + i; | |
if (i.length == 1) return "0" + i; | |
return i; | |
} | |
function updatePlaytime () { | |
var d = new Date() | |
window.requestAnimationFrame(function () { | |
document.getElementById("new_track_time").value = [ | |
d.getHours(), | |
d.getMinutes(), | |
d.getSeconds() | |
].map(padNumber).join(":"); | |
}); | |
} | |
window.setInterval(updatePlaytime, 1000) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool -- we might implement this, or make this an optional feature.