Created
April 28, 2012 14:21
-
-
Save pazguille/2519409 to your computer and use it in GitHub Desktop.
Countdown days
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 countDown = function (finalDate) { | |
var final = new Date(finalDate), | |
today = new Date(), | |
diff = final.getTime() - today.getTime(), | |
days = Math.floor(diff / (1000 * 60 * 60 * 24)), | |
segs = Math.floor(diff / 1000); | |
return days; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment