1.0.3 • Published 7 years ago

rc-date-range v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

rc-date-range

npm.io npm.io npm.io

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

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

npm.io

Getting Started

Installation

$ npm install --save rc-date-range

Usage

Date Picker

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

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)
  • date: (String, Moment.js object, Function) - default: today
  • format: (String) - default: DD/MM/YYY
  • firstDayOfWeek (Number) - default: moment.localeData().firstDayOfWeek()
  • theme: (Object) see Demo's source
  • onInit: (Function) default: none
  • onChange: (Function) default: none

Range Picker

import React, { Component } from 'react';
import { DateRange } from 'rc-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)
  • date: (String, Moment.js object, Function) - default: today
  • format: (String) - default: DD/MM/YYY
  • firstDayOfWeek (Number) - default: moment.localeData().firstDayOfWeek()
  • theme: (Object) see Demo's source
  • onInit: (Function) default: none
  • onChange: (Function) default: none
  • linkedCalendars: (Boolean) default: false
  • calendars: (Number) default: 2
  • ranges: (Object) default: none
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago