Handling of all day events and auto calendar sync on account creation.

This commit is contained in:
Burak Kaan Köse
2026-03-28 01:44:12 +01:00
parent 686446937b
commit 6f61605c12
16 changed files with 393 additions and 10381 deletions
@@ -59,14 +59,15 @@ public class OutlookChangeProcessor(IDatabaseService databaseService,
savingItem = new CalendarItem() { Id = savingItemId };
}
DateTimeOffset eventStartDateTimeOffset = OutlookIntegratorExtensions.GetDateTimeOffsetFromDateTimeTimeZone(calendarEvent.Start);
DateTimeOffset eventEndDateTimeOffset = OutlookIntegratorExtensions.GetDateTimeOffsetFromDateTimeTimeZone(calendarEvent.End);
var eventStartLocalDateTime = OutlookIntegratorExtensions.GetLocalDateTimeFromDateTimeTimeZone(calendarEvent.Start);
var eventEndLocalDateTime = OutlookIntegratorExtensions.GetLocalDateTimeFromDateTimeTimeZone(calendarEvent.End);
var durationInSeconds = (eventEndDateTimeOffset - eventStartDateTimeOffset).TotalSeconds;
var durationInSeconds = (eventEndLocalDateTime - eventStartLocalDateTime).TotalSeconds;
// Store dates as UTC in the database
// Store the wall-clock values exactly as Outlook returned them for the event timezone.
// Timed events are converted for display later, while all-day events stay as floating dates.
savingItem.RemoteEventId = calendarEvent.Id.WithClientTrackingId(calendarEvent.TransactionId.GetClientTrackingId());
savingItem.StartDate = eventStartDateTimeOffset.UtcDateTime;
savingItem.StartDate = eventStartLocalDateTime;
savingItem.DurationInSeconds = durationInSeconds;
// Store the timezone information from the event