Skip to content

Show session event times in local timezone#89

Merged
dekanbro merged 1 commit into
stagingfrom
codex/cr-150-show-session-event-times-in-current-user
Jun 10, 2026
Merged

Show session event times in local timezone#89
dekanbro merged 1 commit into
stagingfrom
codex/cr-150-show-session-event-times-in-current-user

Conversation

@raidguildbot

@raidguildbot raidguildbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • render session/event times in the viewer's browser timezone with explicit timezone labels
  • include start-end time ranges when endsAt is available
  • apply the shared session time display across sessions list/detail, home/dashboard session cards, project cards, and thread cards
  • sort upcoming sessions on /events nearest-first

Verification

  • corepack pnpm --ignore-workspace install
  • corepack pnpm deps:native
  • corepack pnpm exec tsc --noEmit --incremental false
  • corepack pnpm exec prettier --check ...
  • corepack pnpm test:e2e attempted, blocked because Docker is not installed in the runtime: spawnSync docker ENOENT

Closes #88.

Summary by CodeRabbit

  • New Features
    • Session date and time information now displays with improved time zone detection, automatically using your local time zone instead of UTC.
    • Upcoming sessions list now displays in chronological order, showing the earliest sessions first for better planning.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces timezone-aware session time rendering across the Portal frontend. A new SessionDateTime component and supporting helpers detect the user's local timezone and display formatted session times with an explicit timezone label, replacing inline formatDateTime calls.

Changes

Session event timezone localization

Layer / File(s) Summary
SessionDateTime component and helpers
src/app/(frontend)/_components/SessionDateTime.tsx
Two client components: SessionDateTime formats a date range with timezone label into a <time> element; SessionDateBadge formats day-of-month and weekday into <p> elements. Both initialize timezone state to 'UTC', detect user's local timezone via Intl after mount, and render conditionally when dates are valid. Supporting helpers validate dates, format via Intl.DateTimeFormat for the detected timezone, construct timezone labels from timeZoneName parts, and simplify labels by removing trailing suffixes.
Events list and detail pages
src/app/(frontend)/events/page.tsx, src/app/(frontend)/events/[id]/page.tsx
Primary surfaces from issue #88: events/page.tsx imports new components, changes upcoming sort to ascending by startsAt (earliest first), and replaces inline date/weekday rendering in SessionRow with SessionDateBadge and SessionDateTime. events/[id]/page.tsx imports SessionDateTime, removes the inline formatDateTime helper, and renders the sidebar date block with dateStyle="full" and both start/end times.
PortalShell dashboard integration
src/app/(frontend)/_components/PortalShell.tsx
Imports SessionDateTime and replaces four inline formatDateTime calls with the new component across public and member dashboard sections: "Next public session", "Upcoming Sessions" list, "Next session" card, and "Next Upcoming Sessions" panel. All use dateStyle="medium" and pass both startsAt and endsAt.
Project and thread event cards
src/app/(frontend)/projects/[slug]/page.tsx, src/app/(frontend)/threads/[slug]/page.tsx
Remaining event surfaces: projects/[slug]/page.tsx imports SessionDateTime, reorders local date formatting helpers, and replaces inline start date rendering in "Next Sessions" UI with the component using dateStyle="medium". threads/[slug]/page.tsx imports SessionDateTime and uses it in EventCard to render formatted date/time with timezone label, replacing previous start date-only rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • raid-guild/portal#20: Both PRs refactor session date rendering in src/app/(frontend)/events/page.tsx; this PR further replaces the SessionRow date UI with the new SessionDateBadge/SessionDateTime components.

🐰 A timezone dance in every place,
where events now show time and space!
Mountain, Eastern, or UTC too—
Each rabbit sees what's right for you.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly and concisely summarizes the main change: rendering session event times in local timezone across multiple UI components.
Linked Issues check ✅ Passed PR fully addresses #88 objectives: local timezone display with labels, start-end time ranges, consistent formatting across all session surfaces, and nearest-first sorting on /events.
Out of Scope Changes check ✅ Passed All changes are directly scoped to #88: new SessionDateTime component, integration into existing event/session pages, timezone formatting logic, and updated sorting—no unrelated modifications.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cr-150-show-session-event-times-in-current-user

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/app/(frontend)/_components/PortalShell.tsx

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.cjs
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/e

... [truncated 445 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/app/(frontend)/_components/SessionDateTime.tsx

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.cjs
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/e

... [truncated 445 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/app/(frontend)/events/[id]/page.tsx

Oops! Something went wrong! :(

ESLint: 9.39.3

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.cjs
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/e

... [truncated 445 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

  • 3 others

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/app/(frontend)/_components/SessionDateTime.tsx (1)

110-113: 💤 Low value

Consider adding spaces around the dash in time ranges for readability.

The current format produces strings like "2:30 PM-3:30 PM" and "January 15, 2024, 2:30 PM-January 16, 2024, 3:30 PM". Adding spaces around the dash would improve readability: "2:30 PM - 3:30 PM".

♻️ Proposed spacing improvement
   const range =
     startDate === endDate
-      ? `${startDate}, ${startTime}-${endTime}`
-      : `${startDate}, ${startTime}-${endDate}, ${endTime}`
+      ? `${startDate}, ${startTime} - ${endTime}`
+      : `${startDate}, ${startTime} - ${endDate}, ${endTime}`

-  return `${range} ${timeZoneLabel}`
+  return `${range} ${timeZoneLabel}`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/`(frontend)/_components/SessionDateTime.tsx around lines 110 - 113,
The time-range string construction for the range constant in the SessionDateTime
component lacks spaces around the dash; update the template literals that build
range (the ternary using startDate, startTime, endDate, endTime) to use " - "
instead of "-" so the outputs become "2:30 PM - 3:30 PM" and "January 15, 2024,
2:30 PM - January 16, 2024, 3:30 PM".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/app/`(frontend)/_components/SessionDateTime.tsx:
- Around line 110-113: The time-range string construction for the range constant
in the SessionDateTime component lacks spaces around the dash; update the
template literals that build range (the ternary using startDate, startTime,
endDate, endTime) to use " - " instead of "-" so the outputs become "2:30 PM -
3:30 PM" and "January 15, 2024, 2:30 PM - January 16, 2024, 3:30 PM".

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75d96c0d-ebae-476e-9afc-ad34f66a01eb

📥 Commits

Reviewing files that changed from the base of the PR and between 17743e5 and 90c30f4.

📒 Files selected for processing (6)
  • src/app/(frontend)/_components/PortalShell.tsx
  • src/app/(frontend)/_components/SessionDateTime.tsx
  • src/app/(frontend)/events/[id]/page.tsx
  • src/app/(frontend)/events/page.tsx
  • src/app/(frontend)/projects/[slug]/page.tsx
  • src/app/(frontend)/threads/[slug]/page.tsx

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes how session/event times are displayed across the frontend by introducing a shared date/time rendering component that formats in the viewer’s browser-local timezone (with an explicit timezone label) and supports start–end ranges when endsAt is present. It also updates the /events listing to sort upcoming sessions nearest-first.

Changes:

  • Added a shared SessionDateTime (and SessionDateBadge) component to render local-timezone session/event times with timezone labels and optional time ranges.
  • Replaced per-page Intl.DateTimeFormat time rendering with the shared component across events list/detail, portal home/dashboard cards, project cards, and thread cards.
  • Updated /events upcoming sorting to chronological ascending (nearest-first).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/app/(frontend)/threads/[slug]/page.tsx Uses the shared session time component in thread event cards.
src/app/(frontend)/projects/[slug]/page.tsx Uses the shared session time component for project event listings.
src/app/(frontend)/events/page.tsx Uses shared badge/time components and changes upcoming sort order to nearest-first.
src/app/(frontend)/events/[id]/page.tsx Uses the shared session time component on session detail.
src/app/(frontend)/_components/SessionDateTime.tsx Introduces the client-side local-timezone formatting implementation.
src/app/(frontend)/_components/PortalShell.tsx Uses the shared session time component on public home/dashboard session cards.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,168 @@
'use client'

import { useEffect, useState } from 'react'
Comment on lines +29 to +36
const [timeZone, setTimeZone] = useState(fallbackTimeZone)
const label = formatSessionDateTime({ dateStyle, endsAt, startsAt, timeZone })

useEffect(() => {
const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone

if (localTimeZone) setTimeZone(localTimeZone)
}, [])
Comment on lines +52 to +59
const [timeZone, setTimeZone] = useState(fallbackTimeZone)
const badge = formatSessionDateBadge(startsAt, timeZone)

useEffect(() => {
const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone

if (localTimeZone) setTimeZone(localTimeZone)
}, [])
@dekanbro
dekanbro merged commit 74438e9 into staging Jun 10, 2026
2 checks passed
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.

Show session event times in current user local timezone

3 participants