Skip to content

Fix Streak Calculation to Use Effective Today Date - #8759

Open
tmdeveloper007 wants to merge 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8683-todayIndex-effectiveTodayDate
Open

Fix Streak Calculation to Use Effective Today Date#8759
tmdeveloper007 wants to merge 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8683-todayIndex-effectiveTodayDate

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Description

Fixed calculateStreak in lib/calculate.ts to use effectiveTodayStr for todayIndex calculation instead of localTodayStr. This ensures streak calculation respects user timezone settings.

Pillar

  • Other (Bug fix, refactoring, docs)

Checklist

  • I have read the CONTRIBUTING.md file.
  • My commits follow the Conventional Commits format.

Note

Please assign this PR to the tmdeveloper007 account.

Closes #8757

@retenta-bot

retenta-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

This pull request addresses an important bug fix by ensuring that the streak calculation respects user timezone settings. It is similar to previous decisions made regarding the use of effectiveTodayStr for date calculations, which have been validated to improve accuracy in streak tracking. Thank you for your contribution, and please let me know if you need any further assistance!

@retenta-bot retenta-bot Bot changed the title fix : use effectiveTodayDate for todayIndex calculation in streak Fix Streak Calculation to Use Effective Today Date Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4939.27 KB 4939.27 KB 0 B
Total CSS 348.46 KB 348.46 KB 0 B

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected mentor:Aamod007 labels Aug 6, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice fix! Replacing \localTodayStr\ with \effectiveTodayStr\ in the \ odayIndex\ calculation of \lib/calculate.ts\ properly aligns the streak calculation with the user's timezone settings rather than defaulting to the server's or viewer's local time. This is a crucial fix for accuracy. Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : use effectiveTodayDate for todayIndex calculation in streak

2 participants