/react-calendar

DateRange Picker as React Component

Primary LanguageJavaScript

react-date-range-picker

DateRange Picker as React Component

npm version dependencies tests Coverage Status

Installation

npm i react-date-range-picker

Example

import React from 'react'
import { render } from 'react-dom'
import Datepicker from 'react-date-range-picker'

class Demo extends React.Component {
  state = {
    date: new Date().toLocaleString(),
  }

  onClick = date => {
    this.setState({ date: date.toLocaleString() })
  }

  render() {
    return (
      <div className="demo">
        <input type="text" name="date" className="demo__input" value={this.state.date} readOnly />
        <Datepicker onClick={this.onClick} />
      </div>
    )
  }
}

render(<Demo />, document.getElementById('app'))

2015-08-18 11-30-21 react daterange picker

Demo is here

https://isnifer.github.io/react-calendar/