CountDownTimerJS - RealTime CountUp Timer JavaScript Library
npm install countdown-timer-jsClone the repo:
```
git clone git@github.com:webcyou/countdown-timer-js.git
Install with Bower:
``
bower install countdown-timer.js
Install with npm:
``
npm install countdown-timer-js
``
"hh:mm:ss"
`
$3
`
new CountDownTimer("hh:mm:ss", callBack);
`
example
`
new CountDownTimer("12:11:02", function(times, parameters) {
console.log(times);
});
`
or`
new CountDownTimer("12:11:2", function(times, parameters) {
console.log(times);
});
`or Unix Timestamp (milliseconds)
`
new CountDownTimer(953994, function(times, parameters) {
console.log(times);
});
`subscribe
`
let timer = new CountDownTimer("hh:mm:ss");timer.subscribe(function(times, parameters) {
...
});
`
$3
`
new CountDownTimer(Times, function(times, parameters) {
...
});
`time
times: string
`
"hh:mm:ss"
`prams: Time
$3
Time Object
| ParametersName | value | Detail |
| --------------- |:---------------:| -------------------- |
| id | number | created date Id |
| splitTimes | string[] | [hours, minute, second] |
| H | number | hours |
| M | number | minute |
| S | number | minute |
| times | string | "hh:mm:ss" |
| isFinal | boolean | To become true is the one time of 00:00:00 . |
| createdAt | string | Time that was created |
$3
`
let timer = new CountDownTimer("hh:mm:ss");
`| FunctionName | value | Detail |
| --------------- |:---------------:| -------------------- |
| setTimes | string | "hh:mm:ss" change the times |
| getTimes | Time | get the Time Object |
| getTimesStr | string | "hh:mm:ss" get the times |
| isFinal | boolean | To become true is the one time of 00:00:00 |
| subscribe | Function | subscribe CallBack function |
| computeDuration | number to string | Unix Timestamp (milliseconds) convert to "hh:mm:ss" format |
$3
`
npm install
gulp
``
Server started http://localhost:8088
LiveReload started on port 35729
`$3
mocha
`
gulp mocha
`mocha watch
`
gulp mocha.watch
`$3
`
gulp dist
``