Skip to content

feat: display community event times in user local timezone (#2283)#2289

Open
rahul-kr-rai wants to merge 2 commits intojson-schema-org:mainfrom
rahul-kr-rai:feat/localize-event-times-2283
Open

feat: display community event times in user local timezone (#2283)#2289
rahul-kr-rai wants to merge 2 commits intojson-schema-org:mainfrom
rahul-kr-rai:feat/localize-event-times-2283

Conversation

@rahul-kr-rai
Copy link
Copy Markdown

What kind of change does this PR introduce?
Feature: Display Community Event Times in User's Local Timezone.

Issue Number:

Screenshots/videos:

Before

before

After

After

If relevant, did you update the documentation?
N/A

Summary

The "Upcoming events" section on the community page previously displayed times only in UTC. This PR introduces a new LocalizedTime component that detects the user's browser timezone and displays the local time alongside the UTC time. This reduces friction for community members in different regions (APAC, EMEA, Americas, etc.) by eliminating the need for manual timezone conversion.

The implementation uses the native Intl.DateTimeFormat API for a lightweight footprint and handles hydration correctly by waiting for the client-side mount before displaying the localized time.

Changes made:

New Component: Created components/LocalizedTime.tsx which utilizes the native Intl.DateTimeFormat API for lightweight time conversion.

Hydration Fix: Implemented a useEffect hook to ensure time conversion only occurs after the client-side mount, preventing Next.js hydration mismatches between the server (UTC) and the user's browser.

UI Update: Modified pages/community/index.page.tsx to replace static UTC displays with the dynamic LocalizedTime component.

Does this PR introduce a breaking change?
No.

Checklist

…schema-org#2283)

- Implemented LocalizedTime component using Intl API\n- Handled Next.js hydration for client-side timezone detection\n- Fixed serialization error in getStaticProps when calendar fetch fails
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 27, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview ef5463a

Copy link
Copy Markdown
Author

@rahul-kr-rai rahul-kr-rai left a comment

Choose a reason for hiding this comment

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

This PR introduces automatic timezone detection for community events. It includes a fix for a common serialization error when the external iCal calendar is unreachable. Tested across multiple timezones using browser sensors.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4bd72bb) to head (ef5463a).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2289   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          672       672           
  Branches       211       211           
=========================================
  Hits           672       672           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

✨ Enhancement: Display Community Event Times in User’s Local Timezone

1 participant