adrianhajdin / project_corona_tracker

This is a code repository for the corresponding YouTube video. In this tutorial, we are going to build and deploy a corona tracker application. Covered topics: React.js, Chart.js, Material UI, and much more.
https://covid19statswebsite.netlify.com/
1.46k stars 483 forks source link

Invalid Date Found #6

Closed AWAIS97 closed 4 years ago

AWAIS97 commented 4 years ago

Hi, I am getting invalid date on cards and also I found undefine in date buttom of line chart and also when i hover on the line chart. That i am missing?

reetpriye commented 4 years ago

{new Date(lastUpdate).toDateString()} Try adding this.

AWAIS97 commented 4 years ago

I already tried this but this give Invalid Date.

reetpriye commented 4 years ago

Can you share the link of your repository. I'll check and comment back.

AWAIS97 commented 4 years ago

https://github.com/AWAIS97/Covid-19site.git

let me know soon..

reetpriye commented 4 years ago

Just a small thing you missed. It's lastUpdate "capital letter U" You typed small letter everywhere while de-structuring. Check that. I hope everything'll be fine after this.

AWAIS97 commented 4 years ago

Ok I got it. But still undefine in line chart at buttom and in hover.

shaikhreza43 commented 4 years ago

Yeah, Same issue here as well. You can fix it by using today's date. i.e {new Date(Date.now()).toDateString()}

shaikhreza43 commented 4 years ago

Make sure the variable is lastUpdate not lastUpdated. Check in Api and index,js. You migh be using lastUpdated... It worked and solved my issue

AWAIS97 commented 4 years ago

ok bro thanks for sharing