lesca-use-countdown
v1.0.8
Published
countdown date and split to [days, hours, minutes, seconds]
Downloads
25
Readme
Why use it?
count down to specific date.
Live Demo
Installation
npm install lesca-use-countdown --save
Usage
import { useCountdown } from 'lesca-use-countdown';
const [date, setDate] = useCountDown(new Date(2030, 0, 1, 0, 0, 0, 0)); // to 2030
const [days, hours, minutes, seconds] = date;
return (
<div>
<span>{day}</span>days,
<span>{hour}</span>hours,
<span>{minute}</span>minutes,
<span>{second}</span>seconds.
</div>
)
Development
Methods
| method | description | default | | :----------------------------------------------------------------------------------------------------------------- | :-----------------: | ------: | | useCountdown(date:date) | the count down date | 2030 |
Features
- TypeScript
- maintain if necessary