KK Countdown counts down to specific dates in the future.
npm install --save kk-countdown
import KKCountdown from 'kkcountdown';
const countdown = new KKCountdown();
countdown.container = document.getElementById('app-1');
countdown.countTo = '2017-12-12T14:33:00.00';
countdown.start();
container
- HTML element where coutdown should be placed
countTo
- You can set here:
- date (
string
in ISO date format orDate object
) - number (
number
) of seconds to countdown
option | default | description |
---|---|---|
textAfterCount |
'' (string ) |
|
oneDayClass |
'' (string ) |
|
displayDays |
true (bool ) |
|
displayZeroDays |
true (bool ) |
|
customClass |
'' (string ) |
|
warnSeconds |
60 (number ) |
|
warnClass |
'' (string ) |
|
afterFinish |
(function ) |
|
dayText |
day (string ) |
|
daysText |
days (string ) |
|
hourText |
hour (string ) |
|
hoursText |
hours (string ) |
|
minuteText |
: (string ) |
|
minutesText |
: (string ) |
|
secondText |
'' (string ) |
|
secondsText |
'' (string ) |
|
containerClass |
kkcd-container (string ) |
|
secondsClass |
kkcd-seconds (string ) |
|
minutesClass |
kkcd-minutes (string ) |
|
hoursClass |
kkcd-hours (string ) |
|
daysClass |
kkcd-days (string ) |
|
secondsTextClass |
kkcd-seconds-text (string ) |
|
minutesTextClass |
kkcd-minutes-text (string ) |
|
hoursTextClass |
kkcd-hours-text (string ) |
|
daysTextClass |
kkcd-days-text (string ) |