Commit: 5717591
Parent: 50a8783

Use local time for notification calculations

Mårten Åsberg committed on 2026-05-28 at 10:45
MatDenDagen/Services/NotificationService.cs +1 -2
diff --git a/MatDenDagen/Services/NotificationService.cs b/MatDenDagen/Services/NotificationService.cs
index 3087f26..a20bca2 100644
@@ -21,7 +21,6 @@ public sealed class NotificationService(
)
{
private readonly TimeSpan interval = options.Value.CheckInterval;
private readonly TimeSpan timeZoneOffset = options.Value.TimeZoneOffset;
public async Task<DateTimeOffset> CheckAndSendNotificationsAsync(
DateTimeOffset? lastCheck,
@@ -40,7 +39,7 @@ public sealed class NotificationService(
return utcNow;
}
var eventDate = new DateTimeOffset(theDay.ToDateTime(TimeOnly.MinValue, DateTimeKind.Local), timeZoneOffset);
var eventDate = new DateTimeOffset(theDay.ToDateTime(TimeOnly.MinValue, DateTimeKind.Local));
var participants = await questionnaireContext
.Participants.AsNoTracking()
MatDenDagen/Services/NotificationServiceExtensions.cs +0 -2
diff --git a/MatDenDagen/Services/NotificationServiceExtensions.cs b/MatDenDagen/Services/NotificationServiceExtensions.cs
index 0e2b08c..7daceb9 100644
@@ -19,6 +19,4 @@ public static class NotificationServiceExtensions
public sealed class NotificationServiceOptions
{
public TimeSpan CheckInterval { get; set; } = TimeSpan.FromMinutes(5);
public TimeSpan TimeZoneOffset { get; set; } = TimeSpan.FromHours(2);
}