Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix month prop value in navbar component issue#607 #608

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/pages/api/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ export default () => (
receive the following props:
</p>
<ul>
{/* <li>
<li>
<code>month: Date</code> The currently displayed month
</li> */}
</li>
<li>
<code>previousMonth: Date</code>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export default class DayPicker extends Component {
if (!canChangeMonth) return null;

const props = {
month: this.state.month,
month: this.state.currentMonth,
classNames: this.props.classNames,
className: this.props.classNames.navBar,
nextMonth: this.getNextNavigableMonth(),
Expand Down
6 changes: 6 additions & 0 deletions test/daypicker/rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ describe('DayPicker’s rendering', () => {
const wrapper = render(<DayPicker />);
expect(wrapper.find('.DayPicker-NavBar')).toBeDefined();
});
it('should pass corrent month into the navigation bar component', () => {
const NavBar = () => <div />;
const dayPicker = <DayPicker navbarElement={NavBar} />;
const wrapper = shallow(dayPicker);
expect(wrapper.find(NavBar).props().month).toBeDefined();
});
it('should render the aria labels', () => {
const wrapper = mount(<DayPicker />);
expect(wrapper.find('.DayPicker-NavButton--prev')).toHaveProp(
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ define-properties@^1.1.2:
foreach "^2.0.5"
object-keys "^1.0.8"

"definitelytyped-header-parser@github:Microsoft/definitelytyped-header-parser#production":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea why it changed

definitelytyped-header-parser@Microsoft/definitelytyped-header-parser#production:
version "0.0.0"
resolved "https://codeload.github.com/Microsoft/definitelytyped-header-parser/tar.gz/210b44cf9e7e5b9783a41df4f664695ade5325b1"
dependencies:
Expand Down