Skip to content

fix(web): show launch times in local and UTC with explicit labels - #322

Merged
ItsCalebJones merged 5 commits into
masterfrom
feat/launch-time-display
Aug 12, 2026
Merged

fix(web): show launch times in local and UTC with explicit labels#322
ItsCalebJones merged 5 commits into
masterfrom
feat/launch-time-display

Conversation

@ItsCalebJones

Copy link
Copy Markdown
Owner

Reported by a site visitor: launch times on /launch/upcoming/ carry no timezone label and appear to alternate between UTC and viewer-local. They missed launches because of it.

Cause

django-tz-detect activates the session timezone only from the second page view onward — its own README states "Django's timezone awareness will not be available on the first page view." So the first view renders UTC, later views render viewer-local, and an expired session or blocked JS silently reverts to UTC. Nothing on the page said which.

Change

All launch times now render client-side from a UTC ISO-8601 instant through one shared {% launch_time %} tag: local time primary, UTC beneath, both labeled.

  • The precision → display-shape mapping lives in Python, where CI can test it. launch-time.js is left with a single unconditional path.
  • Coarse precisions ("Q3 2026", "During the 2020s") get no timezone and no UTC line — attaching one would claim precision the data lacks.
  • The server emits a fully-rendered labeled UTC fallback, so crawlers and no-JS visitors see a correct time. Previously #date was emitted empty for JS to fill.

Also fixed

  • Mobile launch detail showed no date at all#date was empty in all three branches and the only code filling it was commented out, passing {{ launch.net }} where a precision ID belongs.
  • index, index_mobile and app each overwrote #date via dateFormat(...), which would have clobbered the new markup.
  • LaunchListView gained select_related — the new NET column reads net_precision, and that page already N+1'd on its other FK columns.

Removed

django-tz-detect, moment-timezone.min.js (~180KB), dateFormat.js, and three verbatim copies of getDateFormat. moment.min.js stays — the datetimepicker needs it.

Side benefit: dropping per-session timezone activation makes these pages cacheable again.

Verification

Locally: 11/11 new launch-time tests pass, ruff clean across src/, all edited templates parse, poetry check --lock clean.

Docker was unavailable locally, so the DB-backed regression tests and the rest of the suite run here in CI for the first time.

Spec: docs/superpowers/specs/2026-08-11-launch-time-display-design.md

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

🔍 Quality Check Results

Check Status Result
🔍 Linting success
🧪 Testing success
🔒 Security success

🎉 All quality checks passed! This PR is ready for review.


Triggered by commit af315efView Details

@ItsCalebJones
ItsCalebJones merged commit ebc7602 into master Aug 12, 2026
10 checks passed
@ItsCalebJones
ItsCalebJones deleted the feat/launch-time-display branch August 12, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant