Skip to content

Instantly share code, notes, and snippets.

@BenWard
Created October 15, 2014 08:55
Show Gist options
  • Save BenWard/7f47ee00da22dd52ff09 to your computer and use it in GitHub Desktop.
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.
(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)
})();
@creekfm
Copy link

creekfm commented Nov 15, 2014

Cool -- we might implement this, or make this an optional feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment