ooni / explorer

OONI Explorer: uncover evidence of internet censorship worldwide
https://explorer.ooni.org
BSD 3-Clause "New" or "Revised" License
64 stars 37 forks source link

fix(Stats.js): display correct monthly measurements after changing language #886

Closed Lanius-collaris closed 6 months ago

Lanius-collaris commented 7 months ago

Fixes #873

vercel[bot] commented 7 months ago

@Lanius-collaris is attempting to deploy a commit to the OONI Team on Vercel.

A member of the Team first needs to authorize it.

Lanius-collaris commented 7 months ago

ping @majakomel

Lanius-collaris commented 6 months ago

@sloncocs 🥲Could you review #886 and #884 ?

sloncocs commented 6 months ago

@sloncocs 🥲Could you review #886 and #884 ?

unfortunately, I cannot as I am not a developer 😢 but I think the right person to tag here is @jbonisteel

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 6, 2024 7:07pm
Lanius-collaris commented 6 months ago

🥲This patch doesn't work for master. Checking...

Lanius-collaris commented 6 months ago

🥲This patch doesn't work for master. Checking...

dt.getUTCFullYear() === today.getUTCFullYear() 🤦 In January, you can't get last month data... https://github.com/ooni/explorer/blob/b2f2333c723fb632cf9af3b489845ed82e956ddd/components/landing/Stats.js#L43-L50

Because there is no data in January 2024, after .slice(0,-1), all fields of lastMonth are set to 0.