Skip to content
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

Removed some of the UTC logic which shouldn't be there #7425

Merged
merged 12 commits into from Mar 3, 2023

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Feb 27, 2023

What does this PR do?

Fixes 11:00 - 11:00 All Day date override display issue.

  • Upgrades RHF - this version supports async values so we can start getting rid of useEffect @zomars
  • Pulls in some changes from another PR
  • Remove getServerSideProps
  • Sorts date overrides by ascending date
  • Fixed bug that caused date overrides that were still in the future to be hidden from the listing.

@emrysal emrysal requested a review from zomars as a code owner February 27, 2023 14:00
@vercel
Copy link

vercel bot commented Feb 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 3, 2023 at 2:55AM (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 3, 2023 at 2:55AM (UTC)

@emrysal emrysal requested a review from a team February 27, 2023 14:01
@@ -50,7 +48,7 @@ const DateOverrideList = ({
day: "numeric",
}).format(item.ranges[0].start)}
</h3>
{item.ranges[0].end.getUTCHours() === 0 && item.ranges[0].end.getUTCMinutes() === 0 ? (
{item.ranges[0].end.getHours() === 0 && item.ranges[0].end.getMinutes() === 0 ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

getHours/getMinutes being 0-0 is only possible during an all-day event.

@CarinaWolli
Copy link
Member

It shows 7:00 PM - 7:00 PM now for me 🤔
Screenshot 2023-02-27 at 11 13 14

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 209.97 KB (-1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Fifty-two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user]/book 187.87 KB 397.85 KB 113.67% (🟡 +0.06%)
/apps 169.91 KB 379.88 KB 108.54% (🟡 +0.06%)
/apps/[slug] 193.78 KB 403.76 KB 115.36% (🟡 +0.06%)
/apps/[slug]/[...pages] 392.83 KB 602.8 KB 172.23% (🟡 +0.06%)
/apps/categories 155.24 KB 365.21 KB 104.35% (🟡 +0.06%)
/apps/categories/[category] 158.52 KB 368.49 KB 105.28% (🟡 +0.07%)
/apps/installed/[category] 196.61 KB 406.58 KB 116.17% (🟡 +0.06%)
/auth/forgot-password 181.32 KB 391.29 KB 111.80% (🟡 +0.06%)
/auth/forgot-password/[id] 40.87 KB 250.84 KB 71.67% (🟡 +0.06%)
/auth/login 195.57 KB 405.54 KB 115.87% (🟡 +0.06%)
/auth/setup 242.12 KB 452.09 KB 129.17% (🟡 +0.06%)
/availability 158.47 KB 368.44 KB 105.27% (🟡 +0.06%)
/availability/[schedule] 270.39 KB 480.36 KB 137.25% (🟡 +0.19%)
/availability/troubleshoot 155.93 KB 365.9 KB 104.54% (🟡 +0.07%)
/booking/[uid] 129.84 KB 339.82 KB 97.09% (🟡 +0.06%)
/bookings/[status] 265.37 KB 475.34 KB 135.81% (🟡 +0.07%)
/d/[link]/book 187.53 KB 397.5 KB 113.57% (🟡 +0.07%)
/event-types 351.12 KB 561.1 KB 160.31% (🟡 +0.07%)
/event-types/[type] 384.14 KB 594.11 KB 169.75% (🟡 +0.06%)
/getting-started/[[...step]] 328.91 KB 538.88 KB 153.97% (🟡 +0.06%)
/more 154.87 KB 364.84 KB 104.24% (🟡 +0.06%)
/settings/admin 160.29 KB 370.27 KB 105.79% (🟡 +0.06%)
/settings/admin/apps 193.18 KB 403.15 KB 115.19% (🟡 +0.06%)
/settings/admin/apps/[category] 193.17 KB 403.14 KB 115.18% (🟡 +0.07%)
/settings/admin/impersonation 160.58 KB 370.55 KB 105.87% (🟡 +0.07%)
/settings/billing 160.49 KB 370.46 KB 105.85% (🟡 +0.06%)
/settings/developer/api-keys 189.56 KB 399.53 KB 114.15% (🟡 +0.07%)
/settings/developer/webhooks 162.9 KB 372.87 KB 106.54% (🟡 +0.06%)
/settings/developer/webhooks/[id] 191.84 KB 401.81 KB 114.80% (🟡 +0.07%)
/settings/developer/webhooks/new 191.7 KB 401.67 KB 114.76% (🟡 +0.07%)
/settings/my-account/appearance 174.34 KB 384.32 KB 109.81% (🟡 +0.06%)
/settings/my-account/calendars 192.7 KB 402.67 KB 115.05% (🟡 +0.06%)
/settings/my-account/conferencing 164.75 KB 374.72 KB 107.06% (🟡 +0.07%)
/settings/my-account/general 265.39 KB 475.36 KB 135.82% (🟡 +0.06%)
/settings/my-account/profile 436.99 KB 646.96 KB 184.85% (🟡 +0.06%)
/settings/security/impersonation 162.45 KB 372.42 KB 106.41% (🟡 +0.06%)
/settings/security/password 331.73 KB 541.71 KB 154.77% (🟡 +0.07%)
/settings/security/sso 170.12 KB 380.09 KB 108.60% (🟡 +0.06%)
/settings/security/two-factor-auth 302.94 KB 512.91 KB 146.55% (🟡 +0.06%)
/settings/teams 160.04 KB 370.01 KB 105.72% (🟡 +0.06%)
/settings/teams/[id]/appearance 174.37 KB 384.35 KB 109.81% (🟡 +0.07%)
/settings/teams/[id]/billing 160.27 KB 370.25 KB 105.78% (🟡 +0.07%)
/settings/teams/[id]/members 296.35 KB 506.32 KB 144.66% (🟡 +0.07%)
/settings/teams/[id]/onboard-members 74.07 KB 284.04 KB 81.15% (🟡 +0.07%)
/settings/teams/[id]/profile 272.61 KB 482.58 KB 137.88% (🟡 +0.06%)
/settings/teams/[id]/sso 170.22 KB 380.19 KB 108.63% (🟡 +0.06%)
/settings/teams/new 113.28 KB 323.26 KB 92.36% (🟡 +0.06%)
/signup 25.42 KB 235.39 KB 67.25% (🟡 +0.07%)
/team/[slug]/book 187.53 KB 397.5 KB 113.57% (🟡 +0.07%)
/teams 155.08 KB 365.06 KB 104.30% (🟡 +0.07%)
/workflows 167.98 KB 377.95 KB 107.99% (🟡 +0.06%)
/workflows/[workflow] 295.96 KB 505.94 KB 144.55% (🟡 +0.07%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Async values looks like a nice improvement. Thanks @emrysal 🙏🏽

I can save date overrides for march 1st and 2nd (my date/time when saving was march 1st at 11PM GMT-5). It is saved successfully in the database however the date overrides don't show up in the list.

That's why:

- new Date() is utc so it is already march 2nd
- override.date has always timestamp 00:00 so it is also smaller than the utc time which was in my case 2023-03-02T04:00
@emrysal emrysal requested a review from a team March 3, 2023 02:13
@deploysentinel
Copy link

deploysentinel bot commented Mar 3, 2023

No failed tests 🎉

@emrysal emrysal enabled auto-merge (squash) March 3, 2023 12:52
@emrysal emrysal merged commit 62dcd66 into main Mar 3, 2023
@emrysal emrysal deleted the bugfix/11-00-11-00-dst-issue branch March 3, 2023 13:02
dmkav pushed a commit to join-com/cal-com that referenced this pull request Mar 6, 2023
* Removed some of the UTC logic which shouldn't be there

* Upgrade rhf, remove SSR on [schedule] page

* Fix potential bug with date

* Amend schedule trpc call & don't show edit availability if id is undefined

* type fix

* Order date overrides in list by date

* Changed logic to check for unavailable

* Fix bug report spotted by @CarinaWolli

I can save date overrides for march 1st and 2nd (my date/time when saving was march 1st at 11PM GMT-5). It is saved successfully in the database however the date overrides don't show up in the list.

That's why:

- new Date() is utc so it is already march 2nd
- override.date has always timestamp 00:00 so it is also smaller than the utc time which was in my case 2023-03-02T04:00

* Actual fix, gotta remember it's the schedule tz
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-1146] Date overrides bug
4 participants