Skip to content

fix(bookings): ensure scheduler confirmation email uses booker's time…#28476

Open
ChisomUma wants to merge 1 commit intocalcom:mainfrom
ChisomUma:main
Open

fix(bookings): ensure scheduler confirmation email uses booker's time…#28476
ChisomUma wants to merge 1 commit intocalcom:mainfrom
ChisomUma:main

Conversation

@ChisomUma
Copy link

… format

What does this PR do?

This PR fixes a bug where the scheduler's confirmation email would display the time in a 12-hour format even when the 24-hour format was selected on the booking page.

Changes:

  • Frontend: Updated useHandleBookEvent and the booking-to-mutation mapper to capture and send the booker's timeFormat preference via useTimePreferences.
  • Backend Service: Updated RegularBookingService and the Invitee types to propagate the timeFormat into the CalendarEvent object.
  • Email Templates: Modified AttendeeScheduledEmail (template class) and AttendeeScheduledEmail.tsx (React component) to prioritize the attendee's selected timeFormat over the organizer's default.
  • Fixes time format wrong in scheduler confirmation email #28472

Visual Demo

Note

Verified the fix using automated unit tests. The logic ensures that AttendeeScheduledEmail.ts now calculates the date string using:
const inviteeTimeFormat = this.attendee.timeFormat || this.calEvent.organizer.timeFormat || TimeFormat.TWELVE_HOUR;

Mandatory Tasks (DO NOT REMOVE)

  • [x ] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • [x ] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. (N/A)
  • [x ] I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Automated Test:
    Run the newly added unit test which covers different combinations of organizer/attendee time format preferences:
    yarn vitest packages/emails/templates/attendee-scheduled-email.test.ts
    
  2. Manual Verification:
    Set your system/browser clock to 24-hour format.
    Book an event on a Cal.com instance.
    Verify that the confirmation email received by the booker shows the time in 24h format (e.g., "14:00") while the organizer receives it in their preferred format.

@ChisomUma ChisomUma requested review from a team as code owners March 18, 2026 01:16
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Mar 18, 2026
@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 18, 2026
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/features/bookings/lib/service/RegularBookingService.ts">

<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1390">
P2: Reschedule path does not preserve attendee time format and always uses request `timeFormat`, causing inconsistent attendee-facing time display when callers omit or send a different format.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

firstName: (typeof bookerName === "object" && bookerName.firstName) || "",
lastName: (typeof bookerName === "object" && bookerName.lastName) || "",
timeZone: attendeeTimezone,
timeFormat: reqBody.timeFormat,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 18, 2026

Choose a reason for hiding this comment

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

P2: Reschedule path does not preserve attendee time format and always uses request timeFormat, causing inconsistent attendee-facing time display when callers omit or send a different format.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/bookings/lib/service/RegularBookingService.ts, line 1390:

<comment>Reschedule path does not preserve attendee time format and always uses request `timeFormat`, causing inconsistent attendee-facing time display when callers omit or send a different format.</comment>

<file context>
@@ -1387,6 +1387,7 @@ async function handler(
       firstName: (typeof bookerName === "object" && bookerName.firstName) || "",
       lastName: (typeof bookerName === "object" && bookerName.lastName) || "",
       timeZone: attendeeTimezone,
+      timeFormat: reqBody.timeFormat,
       language: { translate: tAttendees, locale: attendeeLanguage ?? "en" },
     },
</file context>
Fix with Cubic

Copy link
Contributor

@Ryukemeister Ryukemeister left a comment

Choose a reason for hiding this comment

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

hi @ChisomUma, thank you for your contribution. can you attach a visual demo of what this is fix looks like before and after. can you also please resolve the cubic review comments.

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

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

time format wrong in scheduler confirmation email

3 participants