add timestamps to info; helps resolve timezone offset issues
This adds the start and end timestamps to the wire event. This makes it easy to manage the time zones.
Hi, thanks for the PR. In what way does this differ to just reading it off from the event property?
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.
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
@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?
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?