fix(bookings): correct not-started booking window message#28495
fix(bookings): correct not-started booking window message#28495abdulbaqui17 wants to merge 3 commits intocalcom:mainfrom
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect “no availability” messaging when an event’s date-range booking window hasn’t opened yet, and adds related regression coverage. It also includes additional behavior changes around rescheduling duration preservation and attendee email time-format fallback.
Changes:
- Update
NoAvailabilityDialogRANGE copy to show a “Bookings open on …” message whenperiodStartDateis in the future, plus i18n + regression test coverage. - Preserve original booking duration in reschedule redirects by adding a
durationquery param, with SSR tests. - Add attendee email rendering fallback for
timeFormat(use organizer’s when attendee’s is missing) with a test.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/i18n/locales/en/common.json | Adds new English string for “range not started” state. |
| packages/features/calendars/components/NoAvailabilityDialog.tsx | Adds RANGE “not started yet” detection and message selection. |
| packages/features/calendars/tests/NoAvailabilityDialog.test.tsx | Adds regression test for future periodStartDate RANGE messaging. |
| packages/features/bookings/lib/get-booking.test.ts | Adds a unit test for getMultipleDurationValue fallback behavior. |
| packages/emails/templates/attendee-scheduled-email.ts | Ensures attendee timeFormat falls back to organizer’s for rendering. |
| packages/emails/email-manager.test.ts | Adds test coverage for the attendee time-format fallback. |
| apps/web/lib/reschedule/[uid]/getServerSideProps.ts | Adds duration preservation to reschedule redirect URL query params. |
| apps/web/lib/reschedule/[uid]/getServerSideProps.test.ts | Adds tests validating duration preservation in the redirect URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const originalBookingDurationInMinutes = Math.round( | ||
| (booking.endTime.getTime() - booking.startTime.getTime()) / (1000 * 60) | ||
| ); | ||
|
|
||
| if (originalBookingDurationInMinutes > 0) { |
| if (p.periodType === "RANGE") { | ||
| if (p.periodStartDate && dayjs().isBefore(dayjs(p.periodStartDate), "day")) { | ||
| return t("no_availability_range_not_started", { | ||
| date: dayjs(p.periodStartDate).format("MMMM D YYYY"), | ||
| }); | ||
| } | ||
|
|
||
| return t("no_availability_range", { date: dayjs(p.periodEndDate).format("MMMM D YYYY") }); | ||
| } |
Ryukemeister
left a comment
There was a problem hiding this comment.
hi @abdulbaqui17, thank you for your contribution. however for this issue I think we'd like to go with #28480. hence i'm gonna close this in favour of #28480, thanks again.
Summary
Fixes incorrect booking-page messaging for date-range booking windows that start in the future.
Problem
When an event has "Limit future bookings" set to a fixed date range that starts in the future, the booking page currently shows:
That message is incorrect because scheduling has not ended yet; it has not started.
Fix
NoAvailabilityDialogRANGE messaging logic to detect whenperiodStartDateis in the future.i18n
no_availability_range_not_startedto English locale.Tests
periodStartDate.TZ=UTC yarn vitest run packages/features/calendars/__tests__/NoAvailabilityDialog.test.tsxCloses #28470