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

Incorrect Year according to Week Display on Leaderboard #589

Merged
merged 12 commits into from
Jan 2, 2025

Conversation

abhimanyurajeesh
Copy link
Contributor

@abhimanyurajeesh abhimanyurajeesh commented Dec 31, 2024

Since we are following the ISO Week Number Calculation, it was supposed to display as "Week 1 of 2025" instead of "Week 1 of 2024"

The function was supposed correctly identify December 31, 2024 as part of week 1 of 2025 because it falls after the last Thursday of 2024 (which is December 26, 2024). While the function accurately determines the week number, it fails to handle the year correctly.

Bug

This change ensures that both the week number and year correctly reflect the ISO week date standards, especially at the boundaries between years.

Copy link

netlify bot commented Dec 31, 2024

👷 Deploy request for leaderboard-develop pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7a3e56b

@abhimanyurajeesh
Copy link
Contributor Author

This will solve the issue.

@abhimanyurajeesh
Copy link
Contributor Author

image

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today it should be showing week 52/53 of 2024 instead right?

image

@abhimanyurajeesh
Copy link
Contributor Author

According the ISO rule it should be "Week 1 of 2025" but your right, it should make sense to common man.

I have made the changes according.

Updated Code Screenshot

image

@rithviknishad
Copy link
Member

the right answer for today is, week 53.

isn't the current logic incorrect? shows 9 entries for week 52 when i tested your logic.

image

@abhimanyurajeesh
Copy link
Contributor Author

@rithviknishad I fixed the issue, kindly review it.

Thank you!

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan of this complicated logic, but works.

@rithviknishad rithviknishad merged commit 07783d1 into ohcnetwork:main Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants