Created
November 10, 2022 20:39
-
-
Save IvanAdmaers/cd138319ead16b661ba689948910b5a1 to your computer and use it in GitHub Desktop.
FlipDown.js countdown to Christmas
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
const currentYear = new Date().getFullYear(); | |
const deadlineDate = new Date(`12/25/${currentYear}`); | |
const between = Math.abs(Date.now() - deadlineDate.getTime()) / 1000; | |
const timestampInSeconds = Date.now() / 1000 + between; | |
new FlipDown(timestampInSeconds).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment