Skip to content

Advanced date override handling and timezone compatibility improvements#6

Draft
ShashankFC wants to merge 1 commit into
date-algorithm-basefrom
date-algorithm-enhanced
Draft

Advanced date override handling and timezone compatibility improvements#6
ShashankFC wants to merge 1 commit into
date-algorithm-basefrom
date-algorithm-enhanced

Conversation

@ShashankFC

Copy link
Copy Markdown
Collaborator

Test 7nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#7

* fix date override for fixed round robin + time zone in date override

* check if slot is within working hours of fixed hosts

* add test for date override in different time zone

* fix date overrides for not fixed hosts (round robin)

* code clean up

* fix added test

* use the correct timezone of user for date overrides

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
@GitHoobar

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ef328421f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +134
if (dateOverrideExist) {
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep busy checks for date overrides

In checkIfIsAvailable, the early return true when dateOverrideExist is set means any slot that falls on a date override skips the busy evaluation entirely. That makes it possible to return availability even when the host has calendar conflicts/bookings in busy on that override date, leading to double-booking. The busy check should still run after confirming the slot is within the override window.

Useful? React with 👍 / 👎.

Comment on lines +141 to +144
const start = slotStartTime.hour() * 60 + slotStartTime.minute();
const end = slotStartTime.hour() * 60 + slotStartTime.minute();
if (start < workingHour.startTime || end > workingHour.endTime) {
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat split working hours as valid ranges

The predicate inside workingHours.find returns true whenever the slot is outside the current range (lines 141–144), so any non-matching range will cause the slot to be rejected even if another range on the same day contains it. For users with split working hours (e.g., 09:00–12:00 and 13:00–17:00), this makes all slots disappear. The check should instead allow the slot if it fits at least one working-hours interval.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants