-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: weekly limits #10404
fix: weekly limits #10404
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@nicktrn is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review
startTime: dateFrom.toISOString(), | ||
endTime: dateTo.toISOString(), | ||
// needed to correctly apply limits (weeks can be part of two months) | ||
startTime: dateFrom.startOf("week").toISOString(), | ||
endTime: dateTo.endOf("week").toISOString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this affects performance negatively, it would have to be pulled into both limit functions separately, or called with startOf/endOf only if any weekly limits are present.
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unintuitive, but I think that was the case before. AFAIK, start of week is timezone dependent in dayjs. Is there a custom start of week option for users? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@nicktrn i just checked that i had set start of the week to sunday in settings http://localhost:3000/settings/my-account/general. so yeah this works fine
Thanks, @nicktrn 🙏. I assume that this fix has been deployed to cal.com? |
* fix: correctly apply duration limits * fix: weekly limits for weeks in two months --------- Co-authored-by: Udit Takkar <[email protected]>
What does this PR do?
This addresses two bugs related to weekly events, relating to:
Fixes #10361
Fixes #10402
Type of change
How should this be tested?
Availability and booking page tests are passing, but might make sense to add a new test to prevent regressions. Bug (2) was probably always there, but not (1).
Mandatory Tasks
Checklist