-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to support disabling auto correction of dates (#769)
* Changes to support disabling auto correction of dates * Added onChangeDate prop to unit test
- Loading branch information
1 parent
78812d9
commit a95cd86
Showing
5 changed files
with
81 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import moment from 'moment' | ||
import DatePicker from 'react-datepicker' | ||
|
||
export default React.createClass({ | ||
displayName: 'Disable Date Auto Correction', | ||
|
||
getInitialState () { | ||
return { | ||
startDate: moment() | ||
} | ||
}, | ||
|
||
handleChange (date) { | ||
this.setState({ | ||
startDate: date | ||
}) | ||
}, | ||
|
||
render () { | ||
return <div className="row"> | ||
<pre className="column example__code"> | ||
<code className="jsx"> | ||
{'<DatePicker'}<br /> | ||
<strong>{'disableDateAutoCorrection'}<br /></strong> | ||
{'selected={this.state.startDate}'}<br /> | ||
{'onChange={this.handleChange} />'} | ||
</code> | ||
</pre> | ||
<div className="column"> | ||
<DatePicker | ||
disableDateAutoCorrection | ||
selected={this.state.startDate} | ||
onChange={this.handleChange} /> | ||
</div> | ||
</div> | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters