Guest User

Untitled

a guest
Nov 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. counter = (futureDate) ->
  2. today = new Date
  3. count = Math.floor (futureDate - today) / 1000
  4. countdown = setInterval ->
  5. $("#d").html Math.floor count / ( 60 * 60 * 24 )
  6. temp = count % ( 60 * 60 * 24 )
  7. $("#h").html Math.floor temp / ( 60 * 60 )
  8. temp = count % ( 60 * 60 )
  9. $("#m").html Math.floor temp / 60
  10. temp = count % 60
  11. $("#s").html temp
  12.  
  13. counter new Date today.getFullYear(), today.getMonth(), today.getDate() + 1 if count isnt 0
  14. count--
  15. , 1000
  16.  
  17. today = new Date today
  18. counter new Date today.getFullYear(), today.getMonth(), today.getDate() + 1
Add Comment
Please, Sign In to add comment