Skip to content

fix(server): resolve comparison periods in timezone - #51

Merged
jack-arturo merged 9 commits into
mainfrom
fix/pirsch-comparison-timezones
Aug 25, 2026
Merged

fix(server): resolve comparison periods in timezone#51
jack-arturo merged 9 commits into
mainfrom
fix/pirsch-comparison-timezones

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Summary

  • resolve named comparison periods in the request or configured timezone
  • reject reversed same-day clocks after named-period expansion
  • add deterministic MCP contract coverage

Breaking changes

None.

Related to #39.

@jack-arturo jack-arturo added the babysit:active Babysit agent is actively working this PR label Aug 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

const day = now.getUTCDay();

P2 Badge Use the timezone-local weekday for weekly periods

When the requested timezone's calendar date differs from UTC, start represents the local date but now.getUTCDay() represents the UTC date, shifting both week and lastWeek by one day. For example, at 2026-08-03T00:30Z in America/Los_Angeles, the local date is Sunday August 2 but this computes the week start as Sunday August 2 rather than Monday July 27. Derive the weekday from the timezone-normalized start instead.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Aug 23, 2026
Base automatically changed from refactor/pirsch-v2-four-tool-server to main August 23, 2026 20:08
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Aug 23, 2026
@jack-arturo jack-arturo added babysit:waiting-ci Babysit waiting for CI checks on current head and removed babysit:active Babysit agent is actively working this PR labels Aug 23, 2026
@jack-arturo

Copy link
Copy Markdown
Member Author

Fixed in 8a24e45: week and lastWeek now derive the weekday from the timezone-normalized calendar date. Added a Los Angeles midnight-boundary regression test.

@jack-arturo jack-arturo added babysit:ready 👍 Codex all clear + gates pass; human may merge and removed babysit:waiting-ci Babysit waiting for CI checks on current head labels Aug 23, 2026
@jack-arturo
jack-arturo merged commit 172140b into main Aug 25, 2026
7 checks passed
@jack-arturo
jack-arturo deleted the fix/pirsch-comparison-timezones branch August 25, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

babysit:ready 👍 Codex all clear + gates pass; human may merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant