fix: booking page opens on correct month for date-range limited event types#28480
fix: booking page opens on correct month for date-range limited event types#28480Souissi4 wants to merge 5 commits intocalcom:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the booking DatePicker behavior for RANGE-based booking windows by (a) jumping to the start of the allowed window when it’s in the future, and (b) preventing month navigation beyond the configured start/end bounds. It also adds end-to-end coverage for the date range navigation behavior.
Changes:
- Add min/max month navigation disabling in the shared calendars
DatePickercomponent. - In the web booking flow, auto-jump the calendar to the RANGE start month when the window is in the future, and pass min/max dates down to the shared component.
- Add a Playwright E2E test suite validating RANGE window month navigation behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/features/calendars/components/DatePicker.tsx | Adds maxDate handling for next-month disabling and refines prev-month disabling with minDate. |
| apps/web/modules/bookings/components/DatePicker.tsx | Adds effect to jump to RANGE start month and passes minDate/maxDate to shared DatePicker. |
| apps/web/playwright/booking/booking-date-range.e2e.ts | New E2E coverage for RANGE booking window initial month + nav button enabled/disabled states. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
No issues found across 3 files
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-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Ryukemeister
left a comment
There was a problem hiding this comment.
hi @Souissi4, thank you for your contribution. however i'm not sure what would be the ideal behaviour to handle this, I was thinking what if instead of showing first available slot we update the popup dialog message to mention the user has limited slots and then add a button to jump to the first available slot. i'm not sure if this is the ideal or not, lemme talk to the team regarding this. until then i'll convert your PR into draft.
|
hi @Ryukemeister, Thanks for the feedback! |
|
makes sense, all good. i've asked the team about it, will back to you when I have an answer. thank you! |
What does this PR do?
When an event type has "Limit future bookings" set to "Within a date range"
with a future start date, the booking page was opening on the current month
showing no slots and displaying "Scheduling ended on [end date]. Please check
again soon." — even though the booking window had not opened yet. The message
was factually wrong and caused bookers to think the host was permanently
unavailable.
This fix detects when today is before
periodStartDateand automaticallyjumps the calendar to the first month of the booking window. It also disables
the prev/next navigation arrows outside the window boundaries.
Visual Demo (For contributors especially)
demo.mp4
Image Demo (if applicable):
Before — calendar opens on current month with wrong overlay message:

After — calendar opens directly on the first available month:

Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Setup:
Expected (after fix):
Automated tests:
4 tests, all passing.