React-datepicker: Example code for Date Range Picker?

Created on 11 Apr 2017  路  5Comments  路  Source: Hacker0x01/react-datepicker

Where is example code for Date Range? https://hacker0x01.github.io/react-datepicker/#example-13
It is not clear how it works and how to make it work.

What this.handleChangeStart should do?
What this.handleChangeEnd should do?
What for are selectsStart and selectsEnd? What do they do?

<DatePicker
selected={this.state.startDate}
selectsStart  
startDate={this.state.startDate}
endDate={this.state.endDate}
onChange={this.handleChangeStart} />

<DatePicker
selected={this.state.endDate}
selectsEnd  
startDate={this.state.startDate}
endDate={this.state.endDate}
onChange={this.handleChangeEnd} />

Most helpful comment

All 5 comments

Thanks.

However, it is actually confusing. You have examples directory in plugin's root directory examples/hello-world. And there is only one example there. And one might have no idea to check other directories for examples.

I hear you; one improvement could be to add links to the code next to each of the examples on the docs site. PRs for improvements are welcome

For lazier ones (like me): https://reactdatepicker.com/#example-21

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pinturic picture pinturic  路  3Comments

ericreis picture ericreis  路  3Comments

carmouche picture carmouche  路  3Comments

tamitutor picture tamitutor  路  3Comments

arturictus picture arturictus  路  3Comments