1.2.0 • Published 2 years ago

awesome-countdown v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

Awesome countdown

Install

npm install awesome-countdown

Usage

const AwesomeCountdown = require("../index");
const moment = require("moment");
const END_DATE = moment().add(1, 'year').add(9, 'week');

let c = new AwesomeCountdown({
    callback: function () {
        console.log('AwesomeCountdown callback');
    },
    end: END_DATE,
    claim: `<div class="button" onClick="echo();" >timer is set to ${END_DATE}</div>`,
    domId: 'demo',
    lang: {
        "LABELS": {
            "YEARS": "years",
            "MONTHS": "months",
            "DAYS": "days",
            "HOURS": "hours",
            "MINUTES": "minutes",
            "SECONDS": "seconds"
        }

    }
});

c._run();

Parameters

NameDescriptionRequiredTypeDefault
callbacka callback function called at the end of countdownfalsefunctionnull
starttime to start the countdownfalsestring YYYY-MM-DD HH:mm:ss or momentmoment()
endtime to end the countdowntruestring YYYY-MM-DD HH:mm:ss or momentnull
showYearshow year valuefalsebooleantrue
showMonthshow month valuefalsebooleantrue
showDayshow day valuefalsebooleantrue
showHoursho howr valuefalsebooleantrue
showMinutesho minute valuefalsebooleantrue
refreshRatecountdown refresh ratefalsemilliseconds1000 ms
hiddenhide the countdownfalsebooleanfalse
claimthe text displayed under the countdownfalsestringnull
classa custom class for the countdownfalsestringnull
domIddom ID where put countdown infalsestringnull
langlanguage for the labelsfalsestring or objecten

Methods

NameDescription
_runstart the countdown
_resetreset the countdown
_stopstop the countdown

Demo

view Demo

License

Code released under MIT License

Support me

Algorand: M5MTPYJXVW25PAWDAZTLGUN6QMJBMZ44T2675LHUK3QZFN4ZREXOFCUAGI

1.2.0

2 years ago

1.1.0

3 years ago

1.0.36

3 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago