GithubHelp home page GithubHelp logo

andrewgleave / react-time-input Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dima-bu/react-time-input

0.0 3.0 0.0 272 KB

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

Home Page: https://github.com/dima-bu/react-time-input.git#readme

License: MIT License

HTML 8.38% JavaScript 91.62%

react-time-input's Introduction

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] (http://dima-bu.github.io/react-time-input-example/index.html)

Basic Usage

 npm install react-time-input --save

import React from 'react';
import ReactDOM from 'react-dom';
import TimeInput from 'react-time-input';

var TimeWrapper = React.createClass({


   onTimeChangeHandler: function (val) {
   	
   	// do something with this value
   	
   },

   render: function() {
   	return (
   		<TimeInput
   			initTime='11:12'
   			ref="TimeInputWrapper"
   			className='form-control'
   			mountFocus='true'
   			onTimeChange={this.onTimeChangeHandler}
   		/>
   	);
   }
});


export class App extends React.Component {
   render() {
   	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 anyway even for this README :)

react-time-input's People

Contributors

dima-bu avatar hasnat avatar arthurvi avatar axsignalocean avatar nodeenthu avatar spacek33z avatar lrexellio avatar deadlocked247 avatar

Watchers

Andrew Gleave avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.