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

fix: patch dayjs to fix the utc timezone bug #23527

Merged
merged 2 commits into from
Jul 8, 2024
Merged

fix: patch dayjs to fix the utc timezone bug #23527

merged 2 commits into from
Jul 8, 2024

Conversation

skoob13
Copy link
Contributor

@skoob13 skoob13 commented Jul 8, 2024

Problem

Applies a patch with changes from iamkun/dayjs#2118. DayJS incorrectly handles UTC timezone in some cases creating dates for startOf('month') in the past: 2024-07-08 results in 2024-06-30 23:00. Next calls shift the date even more to the past resulting in the bug from #23472.

Changes

DayJS seems to be (temporarily?) abandoned. The PR adds a package patch to fix offsets.

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Manual testing

@skoob13 skoob13 requested a review from a team July 8, 2024 14:24
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

Size Change: +5.2 kB (+0.49%)

Total Size: 1.07 MB

Filename Size Change
frontend/dist/toolbar.js 1.07 MB +5.2 kB (+0.49%)

compressed-size-action

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

I think I actually ran into this problem a long while ago, which is why dayjsUtcToTimezone() has an extra check against UTC/GMT.
Not great that the project is abandoned, but this makes sense as a stopgap

@skoob13 skoob13 merged commit a197a5d into master Jul 8, 2024
91 checks passed
@skoob13 skoob13 deleted the fix/23472 branch July 8, 2024 15:39
thmsobrmlr pushed a commit that referenced this pull request Jul 9, 2024
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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