Skip to content

Commit

Permalink
Pass month prop to navbarElement (#552)
Browse files Browse the repository at this point in the history
* Pass current month to navbarElement

* Update docs

* Update changelog for #552
  • Loading branch information
gpbl committed Nov 15, 2017
1 parent 35c588c commit d523703
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ _The following changes are not released yet, but are on the master branch and wi

* Added [`renderWeek`](http://react-day-picker.js.org/api/DayPicker`renderWeek) prop ([#497](https://github.com/gpbl/react-day-picker/issues/497) by [jenshandersson](https://github.com/jenshandersson))
* Added [`onTodayButtonClick`](http://react-day-picker.js.org/api/DayPicker#onTodayButtonClick) prop ([#529](https://github.com/gpbl/react-day-picker/issues/529))
* Added `month` prop to [`navbarElement`]((http://react-day-picker.js.org/api/DayPicker#navbarElement)) ([#552](https://github.com/gpbl/react-day-picker/issues/552))

**Fixes**

Expand Down
25 changes: 5 additions & 20 deletions docs/src/pages/api/DayPicker.js
Expand Up @@ -341,34 +341,19 @@ export default () => (
</p>
<ul>
<li>
className <code>String</code>
</li>
<li>
previousMonth <code>Date</code>
</li>
<li>
nextMonth <code>Date</code>
</li>
<li>
showPreviousButton <code>Boolean</code>
<code>month: Date</code> The currently displayed month
</li>
<li>
showNextButton <code>Boolean</code>
<code>previousMonth: Date</code>
</li>
<li>
onPreviousClick <code>() ⇒ undefined</code>
<code>nextMonth: Date</code>
</li>
<li>
onNextClick <code>() ⇒ undefined</code>
<code>onPreviousClick: () ⇒ undefined</code>
</li>
<li>
dir <code>String</code>
</li>
<li>
localeUtils <code>Object</code>
</li>
<li>
locale <code>String</code>
<code>onNextClick: () ⇒ undefined</code>
</li>
</ul>
<h3>
Expand Down
1 change: 1 addition & 0 deletions src/DayPicker.js
Expand Up @@ -453,6 +453,7 @@ export default class DayPicker extends Component {
if (!canChangeMonth) return null;

const props = {
month: this.state.month,
classNames: this.props.classNames,
className: this.props.classNames.navBar,
nextMonth: this.getNextNavigableMonth(),
Expand Down

0 comments on commit d523703

Please sign in to comment.