Skip to content

fix(renderer): sales calendar printed each date a day early west of UTC - #4

Merged
SusieeTheLinuxUser merged 1 commit into
devfrom
fix/sale-calendar-dates
Oct 29, 2026
Merged

SusieeTheLinuxUser merged 1 commit into
devfrom
fix/sale-calendar-dates

Conversation

@SusieeTheLinuxUser

Copy link
Copy Markdown
Owner

What was wrong

SALES dates are date-only strings ('2026-12-17'), which JS parses as UTC midnight. fmtDate in renderSalesCalendar formatted 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, 2027 UTC 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

  • New saleDateLabel(d, now) in app.js: formats with timeZone: 'UTC' and checks the year with getUTCFullYear().
  • fmtDate calls it. Nothing else changed.

Validation

  • node tools/preview/selfcheck.mjs: passes. New assertions check saleDateLabel under TZ = America/Los_Angeles, Pacific/Auckland and UTC (expects Dec 17 and Jan 4, 2027). Without timeZone: 'UTC' the check fails with 'Dec 16' !== 'Dec 17' in LA.
  • Also ran selfcheck with TZ=America/New_York: passes.
  • cargo clippy --all-targets -- -D warnings: clean. cargo test: 156 passed, 13 ignored (live network).
  • Not clicked through in the real app; the change is one formatting call.

Left alone

isPast / isLive still 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

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T04:18:37.161100Z 4b2f843 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6d75426-1288-4331-b840-2d4e5fa213a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@SusieeTheLinuxUser
SusieeTheLinuxUser merged commit bc67953 into dev Oct 29, 2026
4 checks passed
@SusieeTheLinuxUser
SusieeTheLinuxUser deleted the fix/sale-calendar-dates branch October 29, 2026 04:36
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.

1 participant