Skip to content

Conversation

@cmraible
Copy link
Collaborator

@cmraible cmraible commented Jan 21, 2026

ref https://linear.app/ghost/issue/NY-381/

Summary

  • Fixed Analytics Overview displaying published_at dates in UTC instead of site timezone
  • Added optional timezone parameter to formatDisplayDate utility function
  • Updated Latest Post and Top Posts components to pass site's configured timezone

Problem

The Analytics > Overview tab was showing post dates in UTC, causing confusion when dates appeared as "tomorrow" for users in timezones behind UTC. This was inconsistent with the Ember admin's posts list which correctly displays dates in the site's configured timezone.

Solution

  • Extended formatDisplayDate in apps/shade/src/lib/utils.ts to accept an optional timezone parameter
  • When timezone is provided, uses moment-timezone to convert ISO dates to the specified timezone
  • Updated latest-post.tsx and top-posts.tsx to read the site timezone from settings and pass it to the formatter

This matches the pattern used in the Ember admin's gh-format-post-time helper.

ref https://linear.app/ghost/issue/NY-381

The Analytics Overview was displaying published_at dates in UTC, causing
confusion when dates appeared as "tomorrow" for users in timezones behind
UTC. This inconsistency with the Ember admin's posts list (which uses site
timezone) made the experience confusing. Added optional timezone parameter
to formatDisplayDate and updated Latest Post and Top Posts components to
pass the site's configured timezone, matching the pattern used elsewhere.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Walkthrough

The pull request updates formatDisplayDate to accept an optional timezone parameter and uses moment-timezone to compute day/month/year, isToday, and isCurrentYear when a timezone is provided for ISO date strings; existing fallback logic remains for non-ISO or no-timezone cases. Unit tests for formatDisplayDate were extended to cover timezone-aware behavior. Multiple stats app components (latest-post, top-posts, growth, newsletters) now read the site timezone from global settings and pass it to formatDisplayDate when rendering published/send dates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing Analytics Overview dates to use site timezone instead of UTC, which matches the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly explains the problem, solution, and changes made, with specific file references and rationale for timezone handling improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cmraible cmraible merged commit 116f950 into main Jan 21, 2026
35 checks passed
@cmraible cmraible deleted the chris-ny-381-analytics-overview-latest-post-and-top-posts-displays branch January 21, 2026 21:59
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.

3 participants