Created
December 11, 2012 17:26
-
-
Save bwinton/4260457 to your computer and use it in GitHub Desktop.
update the time every 5 seconds.
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
var line; | |
var future = new Date(Date.parse("06 Jan 2013 09:00:00 GMT-0500")); // XXX PST vs PDT? | |
var past = new Date(Date.parse("30 Nov 2012 09:00:00 GMT-0500")); | |
line = document.querySelector(".orange"); | |
setTimelineChars(line, future); | |
function setCurrent() { | |
var current = new Date(); | |
line = document.querySelector(".green"); | |
setTimelineChars(line, current); | |
} | |
setCurrent(); | |
setInterval(setCurrent, 5000); | |
line = document.querySelector(".yellow"); | |
setTimelineChars(line, past); | |
console.log("Done! Great Scott!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment