fix: date overrides for availability settings atom#22701
Conversation
WalkthroughA new dependency, Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
| throw new Error(res.data.error?.message); | ||
| }); | ||
| }, | ||
| enabled: isInit && !!accessToken, |
There was a problem hiding this comment.
this saves an API call, noticed previously there was a failing API call since access token is undefined at the start
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/features/schedules/components/DateOverrideList.tsx (1)
90-92: Consider Day.js performance optimization.The Day.js methods
.isBefore()and.isAfter()are used in a potentially performance-critical context (within a map operation). Per coding guidelines, these methods can be slow, especially in timezone mode.Consider using native Date comparisons for better performance:
- !dayjs(item.ranges[0].start).isBefore(travelSchedule.startDate) && - (!dayjs(item.ranges[0].end).isAfter(travelSchedule.endDate) || + item.ranges[0].start.valueOf() >= travelSchedule.startDate.valueOf() && + (item.ranges[0].end.valueOf() <= travelSchedule.endDate?.valueOf() || !travelSchedule.endDate)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
package.json(1 hunks)packages/features/schedules/components/DateOverrideList.tsx(6 hunks)packages/platform/atoms/hooks/schedules/useAtomSchedule.ts(2 hunks)
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/features/schedules/components/DateOverrideList.tsxpackages/platform/atoms/hooks/schedules/useAtomSchedule.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/prisma/schema.prisma:1068-1071
Timestamp: 2025-07-16T05:10:22.891Z
Learning: In PR #22304 for Cal.com private link expiration features, the `maxUsageCount` field was intentionally set to default to 1 (non-nullable) as a breaking change, making all existing private links single-use after migration. This was a deliberate design decision by alishaz-polymath.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
packages/features/schedules/components/DateOverrideList.tsx (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to frontend/**/*.{js,jsx,ts,tsx} : Always use t() for text localization in frontend code; direct text embedding should trigger a warning.
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
package.json (1)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
🧬 Code Graph Analysis (1)
packages/features/schedules/components/DateOverrideList.tsx (2)
packages/platform/atoms/index.ts (1)
useIsPlatform(7-7)packages/config/next-i18next.config.d.ts (1)
i18n(2-5)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/features/schedules/components/DateOverrideList.tsxpackages/platform/atoms/hooks/schedules/useAtomSchedule.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/prisma/schema.prisma:1068-1071
Timestamp: 2025-07-16T05:10:22.891Z
Learning: In PR #22304 for Cal.com private link expiration features, the `maxUsageCount` field was intentionally set to default to 1 (non-nullable) as a breaking change, making all existing private links single-use after migration. This was a deliberate design decision by alishaz-polymath.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
packages/features/schedules/components/DateOverrideList.tsx (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to frontend/**/*.{js,jsx,ts,tsx} : Always use t() for text localization in frontend code; direct text embedding should trigger a warning.
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
package.json (1)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
🧬 Code Graph Analysis (1)
packages/features/schedules/components/DateOverrideList.tsx (2)
packages/platform/atoms/index.ts (1)
useIsPlatform(7-7)packages/config/next-i18next.config.d.ts (1)
i18n(2-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Install dependencies / Yarn install & cache
- GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (10)
package.json (1)
123-123: LGTM! Clean dependency addition.The
date-fns-tzpackage addition supports the timezone-aware formatting implemented in the DateOverrideList component. The version specification with caret range is appropriate.packages/platform/atoms/hooks/schedules/useAtomSchedule.ts (3)
8-8: Good addition of context dependency.Adding the
useAtomsContextimport supports the enhanced query control logic.
14-14: Proper context destructuring.Extracting
isInitandaccessTokenfrom the atoms context provides the necessary state for query control.
30-30: Excellent query control implementation.The
enabledcondition properly prevents the query from running until the atoms context is initialized and an access token is available. This prevents unnecessary API calls and ensures proper authentication state.packages/features/schedules/components/DateOverrideList.tsx (6)
2-2: Good addition of timezone formatting utility.The
formatInTimeZoneimport fromdate-fns-tzenables consistent UTC-based formatting for platform environments.
4-4: Appropriate platform detection hook.The
useIsPlatformhook provides the necessary context for conditional formatting logic.
43-43: Clean platform context integration.The
isPlatformhook usage enables the conditional formatting throughout the component.
55-58: Well-implemented platform-specific time formatting.The conditional logic properly uses
formatInTimeZonefor platform environments while preserving localized formatting for non-platform environments.
72-79: Effective platform-specific date heading formatting.The conditional rendering appropriately uses different date formats based on platform context, maintaining consistency with the overall formatting strategy.
116-124: Platform-appropriate UI element hiding.Hiding the edit button on platform environments aligns with platform-specific UI requirements.
| date: isPlatform | ||
| ? formatInTimeZone(new Date(item.ranges[0].start), "UTC", "h a") | ||
| : new Intl.DateTimeFormat(i18n.language, { | ||
| weekday: "long", | ||
| month: "long", | ||
| day: "numeric", | ||
| timeZone: "UTC", | ||
| }).format(item.ranges[0].start), |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Inconsistent date formatting in delete tooltip.
The platform branch uses time format ("h a") while the non-platform branch uses full date format. This creates inconsistency in the tooltip content - both should probably show the same type of information (date vs time).
Consider using consistent date formatting:
date: isPlatform
- ? formatInTimeZone(new Date(item.ranges[0].start), "UTC", "h a")
+ ? formatInTimeZone(new Date(item.ranges[0].start), "UTC", "EEE MMM dd")
: new Intl.DateTimeFormat(i18n.language, {
weekday: "long",
month: "long",
day: "numeric",
timeZone: "UTC",
}).format(item.ranges[0].start),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| date: isPlatform | |
| ? formatInTimeZone(new Date(item.ranges[0].start), "UTC", "h a") | |
| : new Intl.DateTimeFormat(i18n.language, { | |
| weekday: "long", | |
| month: "long", | |
| day: "numeric", | |
| timeZone: "UTC", | |
| }).format(item.ranges[0].start), | |
| date: isPlatform | |
| ? formatInTimeZone(new Date(item.ranges[0].start), "UTC", "EEE MMM dd") | |
| : new Intl.DateTimeFormat(i18n.language, { | |
| weekday: "long", | |
| month: "long", | |
| day: "numeric", | |
| timeZone: "UTC", | |
| }).format(item.ranges[0].start), |
🤖 Prompt for AI Agents
In packages/features/schedules/components/DateOverrideList.tsx around lines 133
to 140, the date formatting for the delete tooltip is inconsistent between the
platform and non-platform branches, with one showing time and the other showing
a full date. To fix this, unify the formatting by choosing either a time-only or
full date format for both branches, and apply the same formatting method
accordingly to ensure consistent tooltip content.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/features/schedules/components/DateOverrideList.tsx (1)
88-94: Consider optimizing Day.js operations in render path.The Day.js operations (
.isBefore(),.isAfter()) are being executed within a map function during rendering, which could impact performance. Consider memoizing this calculation or moving it outside the render path.+ const travelScheduleForItem = useMemo(() => { + return travelSchedules.find( + (travelSchedule) => + !dayjs(item.ranges[0].start).isBefore(travelSchedule.startDate) && + (!dayjs(item.ranges[0].end).isAfter(travelSchedule.endDate) || + !travelSchedule.endDate) + ); + }, [item.ranges, travelSchedules]); {`${timeSpan(range)} ${ - travelSchedules - .find( - (travelSchedule) => - !dayjs(item.ranges[0].start).isBefore(travelSchedule.startDate) && - (!dayjs(item.ranges[0].end).isAfter(travelSchedule.endDate) || - !travelSchedule.endDate) - ) - ?.timeZone.replace(/_/g, " ") || "" + travelScheduleForItem?.timeZone.replace(/_/g, " ") || "" }`}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
package.json(1 hunks)packages/features/schedules/components/DateOverrideList.tsx(6 hunks)packages/platform/atoms/hooks/schedules/useAtomSchedule.ts(2 hunks)
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/platform/atoms/hooks/schedules/useAtomSchedule.tspackages/features/schedules/components/DateOverrideList.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/prisma/schema.prisma:1068-1071
Timestamp: 2025-07-16T05:10:22.891Z
Learning: In PR #22304 for Cal.com private link expiration features, the `maxUsageCount` field was intentionally set to default to 1 (non-nullable) as a breaking change, making all existing private links single-use after migration. This was a deliberate design decision by alishaz-polymath.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
package.json (1)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
packages/features/schedules/components/DateOverrideList.tsx (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to frontend/**/*.{js,jsx,ts,tsx} : Always use t() for text localization in frontend code; direct text embedding should trigger a warning.
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
🧬 Code Graph Analysis (1)
packages/features/schedules/components/DateOverrideList.tsx (2)
packages/platform/atoms/index.ts (1)
useIsPlatform(7-7)packages/config/next-i18next.config.d.ts (1)
i18n(2-5)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Files:
packages/platform/atoms/hooks/schedules/useAtomSchedule.tspackages/features/schedules/components/DateOverrideList.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/prisma/schema.prisma:1068-1071
Timestamp: 2025-07-16T05:10:22.891Z
Learning: In PR #22304 for Cal.com private link expiration features, the `maxUsageCount` field was intentionally set to default to 1 (non-nullable) as a breaking change, making all existing private links single-use after migration. This was a deliberate design decision by alishaz-polymath.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
package.json (1)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
packages/features/schedules/components/DateOverrideList.tsx (3)
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to frontend/**/*.{js,jsx,ts,tsx} : Always use t() for text localization in frontend code; direct text embedding should trigger a warning.
Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
🧬 Code Graph Analysis (1)
packages/features/schedules/components/DateOverrideList.tsx (2)
packages/platform/atoms/index.ts (1)
useIsPlatform(7-7)packages/config/next-i18next.config.d.ts (1)
i18n(2-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (11)
package.json (1)
123-123: LGTM! Appropriate dependency addition for timezone formatting.The
date-fns-tzpackage is correctly added to support the new timezone-aware date formatting functionality in the DateOverrideList component.packages/platform/atoms/hooks/schedules/useAtomSchedule.ts (3)
8-8: Good addition of authentication context integration.The import of
useAtomsContextproperly supports the conditional query execution based on authentication state.
14-14: Correct destructuring of authentication state.Properly extracting the necessary authentication values to control query execution.
30-30: Excellent defensive programming to prevent unnecessary API calls.The
enabledcondition correctly prevents the query from running until the atoms context is initialized and an access token is available, avoiding the failing API calls mentioned in previous reviews.packages/features/schedules/components/DateOverrideList.tsx (7)
2-2: Correct import for timezone formatting.The
formatInTimeZoneimport fromdate-fns-tzproperly supports the new UTC-based formatting requirements for the platform environment.
4-4: Proper hook import for platform detection.The
useIsPlatformhook import correctly enables conditional rendering and formatting based on the platform environment.
43-43: Good use of platform detection hook.Correctly initializing the platform flag to control conditional behavior throughout the component.
55-58: Clean conditional time span formatting.The platform-specific UTC formatting using
formatInTimeZoneprovides consistent time display for the platform environment while preserving existing localized formatting for non-platform use.
72-79: Consistent conditional date header formatting.The date header formatting correctly uses
formatInTimeZonefor platform environments and maintains the existingIntl.DateTimeFormatfor non-platform environments, ensuring consistent UTC-based display.
116-124: Appropriate platform-specific UI hiding.Correctly hiding the edit button on platform environments while maintaining the existing functionality for non-platform use.
133-140: Consistent conditional formatting for tooltips.The delete button tooltip correctly uses platform-appropriate date formatting, maintaining consistency with the rest of the component's conditional formatting logic.
supalarry
left a comment
There was a problem hiding this comment.
Can you check if editing date override can be fixed? Because now it would be somewhat a "breaking change" that we are removing a feature and I think we have enough time until their launch to fix this and be done with it.
| excludedDates={excludedDates} | ||
| workingHours={workingHours} | ||
| value={item.ranges} | ||
| value={item.ranges.map((range) => ({ |
There was a problem hiding this comment.
the ranges contain an array of object with start and end properties, and the start and end properties are expected to be a new Date object.
for the web app the start and end properties were a new Date object as expected, but for atoms they were always a ISO date string which was causing the override list to break. this makes sure the start and end properties in the range are always consistently a new Date object
supalarry
left a comment
There was a problem hiding this comment.
Tested locally works. Great work!
Can you please add changesets log documenting this atoms change? Every atoms related change needs a log https://github.com/calcom/cal.com/blob/main/packages/platform/atoms/README.md#versioning-1
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
E2E results are ready! |
What does this PR do?
Screen.Recording.2025-07-26.at.6.00.17.PM.mov
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This can be tested in the examples app for platform