feat: display community event times in user local timezone (#2283)#2289
Open
rahul-kr-rai wants to merge 2 commits intojson-schema-org:mainfrom
Open
feat: display community event times in user local timezone (#2283)#2289rahul-kr-rai wants to merge 2 commits intojson-schema-org:mainfrom
rahul-kr-rai wants to merge 2 commits intojson-schema-org:mainfrom
Conversation
…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
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
rahul-kr-rai
commented
Feb 27, 2026
Author
rahul-kr-rai
left a comment
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Feature: Display Community Event Times in User's Local Timezone.
Issue Number:
Screenshots/videos:
Before
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.DateTimeFormatAPI 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.tsxwhich utilizes the native Intl.DateTimeFormat API for lightweight time conversion.Hydration Fix: Implemented a
useEffecthook 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.tsxto replace static UTC displays with the dynamic LocalizedTime component.Does this PR introduce a breaking change?
No.
Checklist