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

Large year value causes `Cannot read property 'length' of undefined` #717

Closed
zarjay opened this Issue May 8, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@zarjay
Copy link

zarjay commented May 8, 2018

Entering a large year value into DayPickerInput causes this error to be thrown:

TypeError: Cannot read property 'length' of undefined
    at Object.f [as getWeekArray] (Helpers.js:112)

To reproduce, enter in a date with large year value into a DayPickerInput field (e.g., 2000008-08-08). (The issue doesn't occur for large month or day values.)

@gpbl

This comment has been minimized.

Copy link
Owner

gpbl commented May 9, 2018

Thanks for finding this out, it seems we need to check the year here:
https://github.com/gpbl/react-day-picker/blob/master/src/DayPickerInput.js#L74
otherwise we go beyond the supported dates.

@gpbl gpbl closed this in 1614d9e May 13, 2018

gpbl added a commit that referenced this issue May 13, 2018

Merge pull request #720 from gpbl/gpbl/717-fix-year-parse
Fix error for long years (close #717)
@gpbl

This comment has been minimized.

Copy link
Owner

gpbl commented May 13, 2018

Thanks this has been fixed in v7.1.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.