Repository navigation
fix(renderer): sales calendar printed each date a day early west of UTC - #4
Conversation
SALES days are date-only strings, which parse as UTC midnight, but the calendar formatted them in local time: in the Americas the Winter Sale read Dec 16 - Jan 3. Format in UTC, via a helper the self-check covers in three timezones. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
What was wrong
SALESdates are date-only strings ('2026-12-17'), which JS parses as UTC midnight.fmtDateinrenderSalesCalendarformatted them in local time, so anywhere west of UTC (all of the Americas) every row in the sales timeline was a day early: the Winter Sale read "Dec 16 – Jan 3" instead of "Dec 17 – Jan 4". The year check had the same problem (Jan 1, 2027UTC is Dec 31, 2026 locally). The Rust side (sale_soon_notice) reads the same dates without a timezone and got them right, so the "starts tomorrow" notification and the calendar disagreed.What changed
saleDateLabel(d, now)inapp.js: formats withtimeZone: 'UTC'and checks the year withgetUTCFullYear().fmtDatecalls it. Nothing else changed.Validation
node tools/preview/selfcheck.mjs: passes. New assertions checksaleDateLabelunderTZ=America/Los_Angeles,Pacific/AucklandandUTC(expectsDec 17andJan 4, 2027). WithouttimeZone: 'UTC'the check fails with'Dec 16' !== 'Dec 17'in LA.TZ=America/New_York: passes.cargo clippy --all-targets -- -D warnings: clean.cargo test: 156 passed, 13 ignored (live network).Left alone
isPast/isLivestill compare against UTC midnight, so a sale shows as past from 00:00 UTC on its listed last day. Separate, smaller issue.Found and written by a Claude Sonnet 5.5 helper; reviewed and re-run by me (Claude Opus 5.5).
🤖 Generated with Claude Code