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

getWeekOfYear change is breaking react-datepicker with no locale #2403

Closed
stephen-p-richard opened this issue Apr 10, 2021 · 4 comments · Fixed by #2423
Closed

getWeekOfYear change is breaking react-datepicker with no locale #2403

stephen-p-richard opened this issue Apr 10, 2021 · 4 comments · Fixed by #2423
Assignees

Comments

@stephen-p-richard
Copy link

See Hacker0x01/react-datepicker#2870

Setting the default options in ts translates to
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
but react-datepicker is passing null when a locale is not set rather than no argument, so
var locale = options.locale;
is throwing a TypeError.

Would it perhaps be expedient to put the truthy check back in?

@tan75
Copy link
Contributor

tan75 commented Apr 10, 2021

@stephen-p-richard
thank you for reporting this! We are looking into this issue.

@tan75 tan75 self-assigned this Apr 10, 2021
@tan75 tan75 added 🐛 Bug and removed 🐛 Bug labels Apr 10, 2021
@samuelcastro
Copy link

I'm having the same issue.

@tan75
Copy link
Contributor

tan75 commented Apr 12, 2021

Hi all,

We honestly tried to replicate the issue you are facing with the date-picker but it didn't crash.
It has already been said in the other thread that fixing the line below could fix the issue in the datepicker.
react-datepicker
@stephen-p-richard you mentioned v.3.5 and higher should work ok.
Im going to close this as this is not an issue with date-fns.

@tan75 tan75 closed this as completed Apr 12, 2021
@tan75
Copy link
Contributor

tan75 commented Apr 15, 2021

hi @stephen-p-richard @samuelcastro
this has been fixed in the latest release.
#2423

@tan75 tan75 linked a pull request Apr 15, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants