2.0.3 • Published 6 years ago

hc-rdr v2.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 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.

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

npm.io

Getting Started

Installation

$ npm install --save react-date-range

Usage

Date Picker

import React, { Component } from 'react';
import { Calendar } from 'react-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
  • minDate: (String, Moment.js object, Function) default: none
  • maxDate: (String, Moment.js object, Function) default: none
  • lang: (String, 'cn' - Chinese, 'jp' - Japanese, 'fr' - French, 'it' - Italian, 'de' - German, 'es' - Spanish, 'ru' - Russian, 'tr' - Turkish, 'pt' - Portuguese, 'fi' - Finnish) default: none

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>
		)
	}
}

TODO

remove react dependency add typescript

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago