React-big-calendar: Passing a dateHeader component breaks month view when navigating

Created on 6 Feb 2018  路  7Comments  路  Source: jquense/react-big-calendar

Do you want to request a _feature_ or report a _bug_?

Bug

What's the current behavior?

If I pass a dateHeader component to the calendar, the month view throws the following error when navigating (using the back/next buttons):

Cannot read property '0' of undefined

For some reason (haven't had time to investigate yet) the length of weeks is 0.

This can be seen in the "custom date header" example in storybook.

bug

Most helpful comment

@berryman17 defaultDate={new Date()}

All 7 comments

@jquense I was also experiencing this issue and noticed that in the handleNavigate handler, the date calculated by moveDate is invalid. To fix this issue, I set defaultDate to the current date and everything works seems to work as expected.

Do you have any thoughts as to why this might be the case? I quickly debugged the issue and can try spending some time this weekend trying to further understand what's going on.

I am having the same issue. How would I go about setting defaultDate to the current date?

events={[]}
formats={formats}
defaultDate={new Date()}
/>

@berryman17 defaultDate={new Date()}

Thank you!

I am also experiencing this issue in v0.19.0 and the defaultDate={new Date()} also seemed to work for me. I am not setting at a dateHeader either.

@maintainers how about updating the docs for this?

Was this page helpful?
1 / 5 - 1 ratings

Related issues

npalansky picture npalansky  路  3Comments

mathieusanchez picture mathieusanchez  路  4Comments

zhming0 picture zhming0  路  3Comments

connercms picture connercms  路  3Comments

tiaaaa123 picture tiaaaa123  路  4Comments