https://github.com/hyunseob/countdown
A simple, lightweight countdown module
https://github.com/hyunseob/countdown
Last synced: 3 months ago
JSON representation
A simple, lightweight countdown module
- Host: GitHub
- URL: https://github.com/hyunseob/countdown
- Owner: HyunSeob
- License: mit
- Created: 2017-10-31T07:59:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-06T05:04:24.000Z (over 7 years ago)
- Last Synced: 2025-03-11T13:33:42.161Z (4 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# countdown
A simple, lightweight countdown module## Example
``` javascript
const countdown = new Countdown(new Date(2017, 10, 30, 23, 59, 59)); // Date must be a future. If you put the past, it will always return zero values.
const $countdown = $('#countdown');countdown.observe(({ days, hours, minutes, seconds }) => {
$countdown.text(`${days}:${hours}:${minutes}:${seconds}`);
});
```