Skip to content

Latest commit

 

History

History
78 lines (64 loc) · 2.71 KB

README.md

File metadata and controls

78 lines (64 loc) · 2.71 KB

KKCountdown

npm package Travis Coverage Status

KK Countdown counts down to specific dates in the future.

Installation / Download

NPM

npm install --save kk-countdown

Import

ES6:

import KKCountdown from 'kkcountdown';

Examples

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 or Date object)
  • number (number) of seconds to countdown

Options

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)