0.0.9 • Published 7 years ago

rawtimeinput v0.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

React Raw Time Input

Project dependencies

  • react
  • moment

Usage

Install the package Install the package.

yarn add rawtimeinput # npm install rawtimeinput --save

Properties

PropertyRequiredDescriptionDefault
valuetrueinitial value string (00:00:00) or instance of momentnone
onChangetruefunction to be called on changenone
onBlurtruefunction to be called on changenone
nametruethe name of the inputnone
secondtrueshould second added on the inputfalse
forceValuetrueshould force to return a value on empty 00:00:00false
disabledtruedisabledfalse
stylefalsecustom inline stylenone

Return Value

Return an object, name and value

value can be empty string if forceValue is set to false and input is leave as blank.

name is the same value passed from the props.

value is an instance of moment, you can parse the value using moment e.g time using moment(value).format('HH:mm:ss')

Example

    <TimeInput
        name="timeOfDate"
        value="12:00:00"
        onChange={e => console.log(objValue)}
        onBlur={e => console.log(objValue)}
        second
        forceValue
    />

Demo

git clone git@github.com:pauldm24/rawtimeinput.git
cd rawtimeinput
yarn # npm install

yarn start # npm start

Browse @ http://localhost:8181

0.0.9

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago