fix: show correct message when RANGE booking window hasn't opened yet#28664
Open
claygeo wants to merge 2 commits intocalcom:mainfrom
Open
fix: show correct message when RANGE booking window hasn't opened yet#28664claygeo wants to merge 2 commits intocalcom:mainfrom
claygeo wants to merge 2 commits intocalcom:mainfrom
Conversation
When an event has a fixed date range (periodType: RANGE), the NoAvailabilityDialog always showed "Scheduling ended on [endDate]" regardless of whether the user was before the start date or after the end date. Both cases triggered noFutureAvailability=true because isTimeViolatingFutureLimit returns true for isBeforeRangeStart OR isAfterRangeEnd. Now distinguishes the two states: - Before periodStartDate → "Scheduling opens on [startDate]. Please check again soon." - After periodEndDate → "Scheduling ended on [endDate]. Please check again soon." (unchanged) Adds i18n key: no_availability_range_not_started Fixes calcom#28470 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 2 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/calendars/components/NoAvailabilityDialog.tsx">
<violation number="1" location="packages/features/calendars/components/NoAvailabilityDialog.tsx:45">
P2: RANGE message classification uses local-time comparison instead of the same normalized timezone basis as period-limit evaluation, which can show the wrong copy near timezone boundaries.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/features/calendars/components/NoAvailabilityDialog.tsx
Outdated
Show resolved
Hide resolved
romitg2
requested changes
Mar 31, 2026
Member
romitg2
left a comment
There was a problem hiding this comment.
please address cubic comments
…valuation The before/after range start comparison used local-time dayjs() which could show the wrong dialog copy near timezone boundaries. Switch to dayjs.utc() so the message classification uses the same normalized timezone basis as calculatePeriodLimits (which parses range dates with dayjs.utc and evaluates with eventUtcOffset=0 in the dialog context).
Ryukemeister
reviewed
Apr 1, 2026
|
|
||
| if (p.periodType === "RANGE") { | ||
| return t("no_availability_range", { date: dayjs(p.periodEndDate).format("MMMM D YYYY") }); | ||
| if (p.periodStartDate && dayjs.utc().isBefore(dayjs.utc(p.periodStartDate))) { |
Contributor
There was a problem hiding this comment.
Author
There was a problem hiding this comment.
Nice idea — a "Jump to date" shortcut would be a solid UX improvement, especially for RANGE windows that open far in the future. Agreed it's a separate PR though. Happy to pick it up as a follow-up if there's interest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR fix?
Fixes #28470
When an event type has a fixed date range (
periodType: RANGE), the "No Availability" dialog always showed:...even when the current date was before
periodStartDate(the booking window hadn't opened yet).Root cause
isTimeViolatingFutureLimitcorrectly returnstruefor both:startOfRangeStartDayInEventTz(isBeforeRangeStart)endOfRangeEndDayInEventTz(isAfterRangeEnd)This makes
noFutureAvailability = truein both cases. ButuseDescriptioninNoAvailabilityDialog.tsxused a single message for the wholeRANGEcase, so users saw "Scheduling ended" even when the window hadn't started.Fix
In
useDescription, check whether today is beforeperiodStartDate. If so, use the newno_availability_range_not_startedmessage instead:Before start date:
After end date (unchanged):
Changes
packages/features/calendars/components/NoAvailabilityDialog.tsx— add pre-start branch inuseDescriptionpackages/i18n/locales/en/common.json— addno_availability_range_not_startedkeyTest plan
periodType: RANGE,periodStartDatein the futureperiodType: RANGE,periodEndDatein the past🤖 Generated with Claude Code