Replaced DateTimeOffset usage in the calendar.

This commit is contained in:
Burak Kaan Köse
2025-05-20 21:08:19 +02:00
parent c4e561dee6
commit aba7539e7d
9 changed files with 47 additions and 67 deletions

View File

@@ -61,18 +61,21 @@ public class OutlookChangeProcessor(IDatabaseService databaseService,
DateTimeOffset eventStartDateTimeOffset = OutlookIntegratorExtensions.GetDateTimeOffsetFromDateTimeTimeZone(calendarEvent.Start);
DateTimeOffset eventEndDateTimeOffset = OutlookIntegratorExtensions.GetDateTimeOffsetFromDateTimeTimeZone(calendarEvent.End);
var durationInSeconds = (eventEndDateTimeOffset - eventStartDateTimeOffset).TotalSeconds;
savingItem.RemoteEventId = calendarEvent.Id;
savingItem.StartDate = eventStartDateTimeOffset.DateTime;
savingItem.StartDateOffset = eventStartDateTimeOffset.Offset;
savingItem.EndDateOffset = eventEndDateTimeOffset.Offset;
savingItem.DurationInSeconds = durationInSeconds;
savingItem.StartTimeOffset = eventStartDateTimeOffset.ToString("O");
savingItem.EndTimeOffset = eventEndDateTimeOffset.ToString("O");
savingItem.Title = calendarEvent.Subject;
savingItem.Description = calendarEvent.Body?.Content;
savingItem.Location = calendarEvent.Location?.DisplayName;
if (savingItem.Title.Contains("Atatürk"))
{
}
if (calendarEvent.Type == EventType.Exception && !string.IsNullOrEmpty(calendarEvent.SeriesMasterId))
{
// This is a recurring event exception.