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

Adjust event position based on timeZone prop #356

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

jackstenglein
Copy link
Contributor

Fixes #276.

The event positioning will now be adjusted based on the timeZone prop, as they were in version 2.7.x. I've also updated the default event editor so that it accounts for the timeZone prop. Users of a custom editor will have to handle that on their own side still.

The changes to App.tsx are for ease of testing and can be reverted when you feel this is ready to merge.

@aldabil21
Copy link
Owner

aldabil21 commented Apr 26, 2024

Hi @jackstenglein
I've finally checked this out
LGTM 🚀
I've found 2 issues to close this

  1. The default selectedDate, we need to get it out of the Object.assign and explicitly set it with getTimeZonedDate. example selectedDate: getTimeZonedDate(selectedDate || new Date(), props.timeZone)
  2. The start time of the Cell will cause issue when dropping event into a Cell, we need to revertTimeZonedDate in useCellAttributes hook, just like to did with the Editor submit function.

If you want to test above issue, steps:

  1. Choose any other timezone than your local zone.
  2. Create an event in 1am cell, its good 👍🏽
  3. Drag & drop it to 2am, the event will increase/decrease the hour differences

Let me know if you can patch these changes

Edit: I've let myself do that, cheers

Co-authored-by: Jack Stenglein <jackstenglein@gmail.com>
@aldabil21 aldabil21 merged commit 4343fac into aldabil21:master Apr 26, 2024
2 checks passed
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.

Issues with timeZone prop
2 participants