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

Segment 7 - "Invalid Date" for Origin Date #20

Open
arpavlic03 opened this issue Oct 3, 2019 · 0 comments
Open

Segment 7 - "Invalid Date" for Origin Date #20

arpavlic03 opened this issue Oct 3, 2019 · 0 comments

Comments

@arpavlic03
Copy link

Hello,

I noticed that during the 07 - accessing - data section that the date-fns library is not formatting the JSON data correctly for originDate due to the fact that a string is being passed in as a string rather than a Date Object. When that happens, the date shows up as "Invalid Date" in the module as you implement new code regarding accessing data APIs.

I was able to fix it by doing this in data.js (line 12)
h.originDate = format((new Date(h.originDate).getFullYear(), new Date(h.originDate).getMonth(), new Date(h.originDate).getDay()), inputDateFormat);

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

1 participant