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

Render Custom Header example has an error #1691

Closed
lzpat opened this issue Apr 1, 2019 · 4 comments
Closed

Render Custom Header example has an error #1691

lzpat opened this issue Apr 1, 2019 · 4 comments

Comments

@lzpat
Copy link

lzpat commented Apr 1, 2019

When selecting a month from the month dropdown menu, it results in a NaN error.

{months.map(option => (
                    <option key={option} value={option}>
                      {option}
                    </option>
                  ))}
</select>

This fixes the error:

{months.map((option, i) => (
                              <option key={option} value={i}>
                                {option}
                              </option>
                            ))}

https://github.com/Hacker0x01/react-datepicker/blob/master/docs-site/src/examples/render_custom_header.jsx

@wilarz89
Copy link

wilarz89 commented May 6, 2019

I add this code and it works but now it does not load the month of the actual date.
Did this happen to you?

@mjangir
Copy link
Contributor

mjangir commented Aug 21, 2019

Fixed the custom header issue in this PR:

#1856

Waiting for it to be merged.

@martijnrusschen
Copy link
Member

Fixed by #1856

@iloveip
Copy link

iloveip commented Dec 17, 2019

I still have a problem. I just copy/ pasted the code from the example, but the app crashed when I open the datepicker. And it shows an error:

TypeError: Object(...) is not a function
...
value={months[getMonth(date)]}

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

No branches or pull requests

5 participants