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

Passing a dateHeader component breaks month view when navigating #718

Closed
tobiasandersen opened this issue Feb 6, 2018 · 7 comments
Closed
Labels

Comments

@tobiasandersen
Copy link
Collaborator

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.

@KerenChandran
Copy link

KerenChandran commented Feb 9, 2018

@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.

@ianberryman
Copy link

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

@irerv
Copy link

irerv commented Feb 16, 2018

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

@STEVEOO6
Copy link

@berryman17 defaultDate={new Date()}

@ianberryman
Copy link

Thank you!

tasn added a commit to etesync/etesync-web that referenced this issue Feb 22, 2018
@drewandrew
Copy link

drewandrew commented Mar 26, 2018

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.

@swyxio
Copy link

swyxio commented Apr 27, 2018

@maintainers how about updating the docs for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants