Skip to content

Conversation

@Athuli7
Copy link

@Athuli7 Athuli7 commented Apr 25, 2025

This adds the start and end timestamps to the wire event. This makes it easy to manage the time zones.

@lukas-frey
Copy link
Contributor

Hi, thanks for the PR. In what way does this differ to just reading it off from the event property?

@Athuli7
Copy link
Author

Athuli7 commented Apr 25, 2025

The event property gives the date-time string without the timezone information, so we have no way of knowing the actual time without writing extra code to extract the browser timezone.

@darren-glanville
Copy link

This would be great as I have a multi-county system with user preferences for timezone and hard to get the dates to work correctly

@darren-glanville
Copy link

darren-glanville commented May 1, 2025

@Athuli7 I found an interesting way to make it work for me:

Within event is the delta array, I have an appointment Im chaning and did the following:

$change = data_get($info, 'delta.seconds') / 3600;

$start_time = $appointment->start_time->addHours($change); $end_time = $appointment->end_time->addHours($change);

That works for dragging and dropping an event. For resizing you can use endDelta instead.

Hope that helps?

@lukas-frey
Copy link
Contributor

Hi guys, did you see https://github.com/GuavaCZ/calendar/discussions/74#discussioncomment-12336179?

If you shift the timezone to UTC in your toCalendarEvent method on the server side, then the calendar should work with the same times.

This is because the underlying package doesn't support changing the timezone sadly.

But otherwise, maybe doing something like this solution might be worth? This seems like a little better way to fix this issue.

What do you think?

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