Skip to content

Fix analytics period keys that select the wrong month - #1086

Open
agammann wants to merge 1 commit into
standardnotes:mainfrom
agammann:fix/analytics-period-month-overflow
Open

agammann wants to merge 1 commit into
standardnotes:mainfrom
agammann:fix/analytics-period-month-overflow

Conversation

@agammann

@agammann agammann commented Dec 4, 2026

Copy link
Copy Markdown

Fixes #1084.

Changes

  • Build monthly and daily keys from the requested month, including January (month index 0). This avoids rolling into the following month when the current date is near month end.
  • Read the month directly from a monthly key so conversion is independent of the server time zone.
  • Cover January, February on January 31, Q2 on May 31, and monthly key conversion in the regression tests.

Verification

On Node 20, all 52 analytics tests passed with 100% coverage. The focused period key tests passed in UTC and America/Los_Angeles. The analytics build and ESLint for the changed files 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.

Analytics period keys can select the wrong month

1 participant