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
jr-codes opened this issue May 8, 2018 · 2 comments
Closed
Labels
good first issue Good for newcomers

Comments

@jr-codes
Copy link

jr-codes 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
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 as completed in 1614d9e May 13, 2018
gpbl added a commit that referenced this issue May 13, 2018
@gpbl
Copy link
Owner

gpbl commented May 13, 2018

Thanks this has been fixed in v7.1.9

kimamula pushed a commit to kimamula/react-day-picker that referenced this issue Aug 17, 2022
kimamula pushed a commit to kimamula/react-day-picker that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants