calendar icon indicating copy to clipboard operation
calendar copied to clipboard

add timestamps to info; helps resolve timezone offset issues

Open Athuli7 opened this issue 8 months ago • 5 comments

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

Athuli7 avatar Apr 25 '25 15:04 Athuli7

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

lukas-frey avatar Apr 25 '25 18:04 lukas-frey

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.

Athuli7 avatar Apr 25 '25 20:04 Athuli7

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 avatar Apr 27 '25 20:04 darren-glanville

@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?

darren-glanville avatar May 01 '25 06:05 darren-glanville

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?

lukas-frey avatar May 01 '25 07:05 lukas-frey