Skip to content

Instantly share code, notes, and snippets.

@gpedote
Created July 9, 2014 23:35
Show Gist options
  • Save gpedote/671aded8d03d396801fe to your computer and use it in GitHub Desktop.
Save gpedote/671aded8d03d396801fe to your computer and use it in GitHub Desktop.
Brazil x Germany, source: www.brasilalemanhaeterno.com
$(document).ready(function() {
var gameStartDiff = Math.abs(new Date() - new Date('2014/07/08 17:00:00'));
var minuteInMileseconds = 60 * 1000;
var update = function () {
var brazilGoals = Math.round(gameStartDiff / (90 * minuteInMileseconds));
var germanGoals = Math.round(gameStartDiff / (12 * minuteInMileseconds));
$('#brazil-goals').html(brazilGoals);
$('#german-goals').html(germanGoals);
}
setTimeout(function(){ update(); }, 60000);
update();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment