Code Monkey home page Code Monkey logo

react-inline-date's Introduction

react-inline-date

React Date Input Component.

Demo

https://cheekujha.github.io/react-inline-date/

Install

You need to have react and react-dom as dependencies in your project.

  1. With npm installed, run
$ npm install react-inline-date --save
  1. At this point you can import react-inline-date in your application as follows:
import DateInput from 'react-inline-date';

Usage

  1. Wrap header columns (th / td) with TableFilter as shown below.
import React from 'react';
import DateInput,{TYPE_DATE} from 'react-inline-date';

class Example extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      startDate: undefined
    };
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(timestamp) {
    this.setState({
      startDate: timestamp
    });
  }

  render() {
    return <DateInput
        type={TYPE_DATE}
        value={this.state.startDate}
        onCommit={this.handleChange}
    />;
  }
}

API

Properties

DateInput

Name Type Default Required Description
type String 'date' true Can be one of ['date', 'datetime', 'time']
value Timestamp undefined false Initial Value
onCommit function(timestamp, event) true Function called when a date is selected
maxOffset Timestamp false Date Upper limit
minOffset Timestamp false Date Lower Limit

License

MIT

react-inline-date's People

Contributors

ltprashant avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

react-inline-date's Issues

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.