0.3.0 • Published 7 years ago

awesome-react-date v0.3.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
7 years ago

react-date-range

npm.io npm.io npm.io

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

Extend from https://github.com/Adphorus/react-date-range

  • Addtionals:
  • weekdaysFormat
  • monthsFormat
  • leftButton: customize left month button
  • rightButton: customize right month button

Live Demo : http://phattranky.github.io/awesome-react-date

npm.io

Getting Started

Installation

$ npm install --save awesome-react-date

Usage

Date Picker

import React, { Component } from 'react';
import { Calendar } from 'awesome-react-date';

class 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

import React, { Component } from 'react';
import { DateRange } from 'react-date-range';

class 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)
0.3.0

7 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago