Skip to content

fix(bookings): correct not-started booking window message#28495

Closed
abdulbaqui17 wants to merge 3 commits intocalcom:mainfrom
abdulbaqui17:fix-28470-booking-window-message
Closed

fix(bookings): correct not-started booking window message#28495
abdulbaqui17 wants to merge 3 commits intocalcom:mainfrom
abdulbaqui17:fix-28470-booking-window-message

Conversation

@abdulbaqui17
Copy link

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:

  • "Scheduling ended on [end date]. Please check again soon."

That message is incorrect because scheduling has not ended yet; it has not started.

Fix

  • Updated NoAvailabilityDialog RANGE messaging logic to detect when periodStartDate is in the future.
  • In that state, it now shows:
    • "Bookings open on {{date}}. Please check again soon."
  • Existing RANGE behavior for already-ended windows remains unchanged.

i18n

  • Added no_availability_range_not_started to English locale.

Tests

  • Added regression test covering RANGE with future periodStartDate.
  • Ran:
    • TZ=UTC yarn vitest run packages/features/calendars/__tests__/NoAvailabilityDialog.test.tsx

Closes #28470

Copilot AI review requested due to automatic review settings March 19, 2026 03:10
@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 19, 2026
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

No issues found across 8 files

Copy link

Copilot AI left a comment

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 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 NoAvailabilityDialog RANGE copy to show a “Bookings open on …” message when periodStartDate is in the future, plus i18n + regression test coverage.
  • Preserve original booking duration in reschedule redirects by adding a duration query 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.

Comment on lines +185 to +189
const originalBookingDurationInMinutes = Math.round(
(booking.endTime.getTime() - booking.startTime.getTime()) / (1000 * 60)
);

if (originalBookingDurationInMinutes > 0) {
Comment on lines 44 to 52
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") });
}
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 @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.

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

Labels

🐛 bug Something isn't working size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Booking page shows "Scheduling ended" message when booking window hasn't opened yet

4 participants