Skip to content

Conversation

@deepakjois
Copy link
Owner

The newsletter covers Sunday to Saturday, but ISO week numbers change on Monday. Previously the code used Sunday's week number which could result in showing the previous week's number. Now it correctly uses Monday's week number for consistency.

Changes:

  • Extract date calculation into testable calculateNewsletterWeek function
  • Add NewsletterWeek struct to hold all week information
  • Use Monday's ISOWeek() for year and week number
  • Add comprehensive tests including year transition edge cases

The newsletter covers Sunday to Saturday, but ISO week numbers change on
Monday. Previously the code used Sunday's week number which could result
in showing the previous week's number. Now it correctly uses Monday's
week number for consistency.

Changes:
- Extract date calculation into testable calculateNewsletterWeek function
- Add NewsletterWeek struct to hold all week information
- Use Monday's ISOWeek() for year and week number
- Add comprehensive tests including year transition edge cases
@deepakjois deepakjois merged commit 97ddd8e into main Dec 29, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants