Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-time-input

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-time-input

A simple react component for select time in format HH:mm

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
increased by12.61%
Maintainers
2
Weekly downloads
 
Created
Source

Contributor: Dima Bukhal - dimabuhal@gmail.com Collaborators: Dima Bukhal - dimabuhal@gmail.com, arthurvi (https://github.com/arthurvi, https://www.npmjs.com/~arthurvi)

If you want be contributors or collaborators - write me on dimabuhal@gmail.com with the theme 'react-time-input IMPORTANT'

What's in it?

A simple react component for select time in format HH:mm timeInput.jsx Its used webpack for building and es6 syntax

Demo page

Basic Usage

 npm install react-time-input --save


const TimeWrapper = () => {

   const onFocusHandler = (event) => {
       console.log("hello there you entered :  my name is ", event.target.name);
   }

   const onBlurHandler = (event) => {
       console.log("you left ");
   }

   const onTimeChangeHandler = (val) => {
       if (val.length === 5) {
           // do something with this value
       }
   }

   return (
       <TimeInput
           name="example"
           initTime='11:12'
           className='s-input -time'
           mountFocus='true'
           onTimeChange={onTimeChangeHandler}
           onFocusHandler={onFocusHandler}
           onBlurHandler={onBlurHandler}
       />
   );

}

function App() {
   return (
       <TimeWrapper/>
   );

}

ReactDOM.render(<App/>, document.querySelector("#myApp"));

To run

  • You'll need to have git and node installed in your system.
  • Fork and clone the project:
> $ git clone https://github.com/dima-bu/react-time-input.git

Then install the dependencies:

 npm install

You can simply run webpack example build using this command:

npm run example

Open in the web browser file ./example/index.html

Create build

npm run build

Please contribute to the project if you think this can be done better in any way even for this README :)

Keywords

FAQs

Package last updated on 19 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc