Last active
June 20, 2017 19:25
-
-
Save NFodrea/b1dcf3804bd8f6f22a73b96e823580cf to your computer and use it in GitHub Desktop.
Format Days Hours Seconds Minuets for countdown timer
This file contains hidden or 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
| getTimeUntill (deadline) { | |
| let time = Date.parse(deadline) - Date.parse(new Date()); | |
| let seconds = Math.floor((time/1000) % 60); | |
| let minuets = Math.floor((time/1000/60) % 60); | |
| let hours = Math.floor(time / (1000*60*60) % 24); | |
| let days = Math.floor(time / (1000*60*60*24)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment