1.1.0 • Published 3 years ago

countdown-x v1.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

How to install

You can using a in 2 way

    npm install countdown-x
    npm i countdown-x

How to use

See the example below to use it

    var countdownX = require("countdown-x");

    // Using: countdown
    setInterval(() => {
        // it's was called every seconds

        console.log(countdownX.fromNow().countdown("2033/12/10 16:23:00")) // {days: 8, hours: "00", minutes: "05", months: 2, seconds: 44, years: 13}
    }, 1000)


    // Using: countdownEvery
    countdownX
    .fromNow()
    .countdownEvery("2033/12/10 16:23:00", { ms: 1000 }, (values) => {
        // Do something with values
        // it's was called every seconds
        
        console.log(values); // {days: 8, hours: "00", minutes: "05", months: 2, seconds: 44, years: 13}
    });

Documentation

  • eventDate format (ISO 8601 - UTC): yyyy/mm/dd HH:MM:SS
APIDescriptionReturn
fromNow()Setup countdown destinationvoid
countdown(eventDate)The countdown function{days, hours, minutes, months, seconds, years}
countdownEvery(eventDate, options{ms: number}, callback)The countdown function automatically according to predetermined timevoid

Versions history

The versionDescriptionIssues
v1.0.0Project initializationNo issue
v1.0.1Clean codeNo issue
v1.0.2Clean codeNo issue
v1.0.3Clean codeNo issue
v1.0.4FixThe countdown time is wrong
v1.0.4-1Refactoring the source codeStructure
v1.0.4-2Change example codeNo issue
v1.0.5Add type and supported suggest codeNo issue
v1.1.0add new function support auto setIntervalNo issue
1.1.0

3 years ago

1.0.5

3 years ago

1.0.4-1

3 years ago

1.0.4-2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago