my-clock-component v1.0.2
Introduction
React clock component
Installation
Run npm i my-clock-component
Use:
import {Clock} from 'my-clock-component'
<Clock show={[true,true,true]} insertion={[':',':','']} twentyFourFormat={false} />
Props
This takes three props show, insertion and twentyFourFormat.
By default show
is set to true,true,false.
This props lets you show hours, minutes and seconds based on the array index value.
Here show[0]
is true which means hours value will be displayed, whereas show[1]
is false which means seconds value will not be displayed.
By default insertion
is set to ':',':',''.
This props helps us append values at the end of hour, minutes and second respectively based on the array index value.
Here show[0]
is :
which means :
at the end of hour value, similary you can also set show[0]
as hour
.
By default twentyFourFormat
is set to false
.
This props helps you set the clock as 24hours (15:30)
or 12hours (03:30)
format.