Skip to content

Instantly share code, notes, and snippets.

@HeathHopkins
Created March 29, 2012 16:00
Show Gist options
  • Save HeathHopkins/2238932 to your computer and use it in GitHub Desktop.
Save HeathHopkins/2238932 to your computer and use it in GitHub Desktop.
Blackboard counter
<html>
<head>
<title>Blackboard Countdown</title>
</head>
<body>
<!-- Copy below this line -->
<h2>
<script type="text/javascript">
(function () {
var endDate = new Date(2012, 11, 21, 0, 0, 0);
var secs = Math.floor((endDate.getTime() - (new Date()).getTime()) / 1000);
if (secs < 0) {
document.write('Blackboard is no longer available.');
} else {
var days = Math.floor(secs / 86400);
if (days === 0) {
document.write('Today is the last day that Blackboard is available.');
return;
}
var daystring = days === 1 ? ' day.' : ' days.';
document.write('Blackboard will no longer be available in ' + days + daystring);
}
})();
</script>
</h2>
<!-- Copy above this line -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment