1.2.4 • Published 1 year ago

@alim1496/simple-react-timepicker v1.2.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

simple-react-timepicker

This repository contains simple timepicker to be used in React applications. You can edit the time here & also select time from dropdown. Currently it supports 24hr format only. I am planning to add more features gradually. It has been developed using typescript.

Installation

NPM

npm install @alim1496/simple-react-timepicker

Usage

Normal use along with dropdown

import React from 'react'
import TimePicker from '@alim1496/simple-react-timepicker'

const MyApp = () => {
	const onChange = (val: string) => {
		console.log(val)
	}

	return (
		<TimePicker time="4:20" onChange={onChange} />
	)
}

export default MyApp

Properties

PropertyTypeDefault ValueDescription
timestring''The initial time to be displayed. If not passed then the current hour & minute value are displayed.
showListbooleantrueWhether to display the dropdown time values. If false then it is not displayed.
minHournumber0The minimum value of hour the user is allowed to input.
maxHournumber23The maximum value of hour the user is allowed to input.
onChangefunction(time: string) => voidThis function helps the user to capture the changed time as string in hh:mm format.
classNamestring''The name of the class containing customm css rules to be applied.

License

MIT © alim1496

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago