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! 🙏 |
| 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.
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! 🙌 |
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? |
Udit-takkar
left a comment
There was a problem hiding this comment.
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 <53316345+Udit-takkar@users.noreply.github.com>

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