Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- counter = (futureDate) ->
- today = new Date
- count = Math.floor (futureDate - today) / 1000
- countdown = setInterval ->
- $("#d").html Math.floor count / ( 60 * 60 * 24 )
- temp = count % ( 60 * 60 * 24 )
- $("#h").html Math.floor temp / ( 60 * 60 )
- temp = count % ( 60 * 60 )
- $("#m").html Math.floor temp / 60
- temp = count % 60
- $("#s").html temp
- counter new Date today.getFullYear(), today.getMonth(), today.getDate() + 1 if count isnt 0
- count--
- , 1000
- today = new Date today
- counter new Date today.getFullYear(), today.getMonth(), today.getDate() + 1
Add Comment
Please, Sign In to add comment