FormidableLabs/react-date-range

Name: react-date-range

Owner: Formidable

Description: A React component for choosing dates and date ranges.

Forked from: Adphorus/react-date-range

Created: 2016-12-14 16:38:36.0

Updated: 2016-12-14 16:38:38.0

Pushed: 2016-12-14 17:58:52.0

Homepage: null

Size: 267

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

react-date-range

A React component for choosing dates and date ranges. Uses Moment.js for date operations.

Live Demo : http://adphorus.github.io/react-date-range

Getting Started
Installation
m install --save react-date-range
Usage
Date Picker
rt React, { Component } from 'react';
rt { Calendar } from 'react-date-range';

s MyComponent extends Component {
handleSelect(date){
    console.log(date); // Momentjs object
}

render(){
    return (
        <div>
            <Calendar
                onInit={this.handleSelect}
                onChange={this.handleSelect}
            />
        </div>
    )
}

Available Options (props)
Range Picker
rt React, { Component } from 'react';
rt { DateRange } from 'react-date-range';

s MyComponent extends Component {
handleSelect(range){
    console.log(range);
    // An object with two keys,
    // 'startDate' and 'endDate' which are Momentjs objects.
}

render(){
    return (
        <div>
            <DateRange
                onInit={this.handleSelect}
                onChange={this.handleSelect}
            />
        </div>
    )
}

Available Options (props)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.