diff --git a/src/Miha.Discord/Services/Hosted/GuildEventScheduleService.cs b/src/Miha.Discord/Services/Hosted/GuildEventScheduleService.cs index b26605b..8e0f70b 100644 --- a/src/Miha.Discord/Services/Hosted/GuildEventScheduleService.cs +++ b/src/Miha.Discord/Services/Hosted/GuildEventScheduleService.cs @@ -13,7 +13,6 @@ using Miha.Discord.Services.Interfaces; using Miha.Logic.Services.Interfaces; using Miha.Shared.ZonedClocks.Interfaces; -using NodaTime; using NodaTime.Extensions; namespace Miha.Discord.Services.Hosted; @@ -164,10 +163,14 @@ private async Task PostWeeklyScheduleAsync() .WithAuthor("Weekly event schedule", _client.CurrentUser.GetAvatarUrl()); postedHeader = true; } - - var dayUnspecified = day.ToDateTimeOffset(); - var dayInEst = day.ToLocalDateTime().Date.AtStartOfDayInZone(_easternStandardZonedClock.GetTzdbTimeZone()).Date.ToString("dddd", new CultureInfo("en-us")); - description.AppendLine("### " + dayInEst + " - " + dayUnspecified.ToDiscordTimestamp(TimestampTagStyles.ShortDate)); + + var dayInEst = day + .ToLocalDateTime() + .InZoneLeniently(_easternStandardZonedClock.GetTzdbTimeZone()) + .Date + .ToString("dddd", new CultureInfo("en-us")); + + description.AppendLine("### " + dayInEst + " - " + day.ToDateTimeOffset().ToDiscordTimestamp(TimestampTagStyles.ShortDate)); foreach (var guildEvent in events.OrderBy(e => e.StartTime)) { @@ -210,7 +213,7 @@ private async Task PostWeeklyScheduleAsync() .WithColor(new Color(255, 43, 241)) .WithDescription(description.ToString()); - await weeklyScheduleChannel.SendMessageAsync(embed: embed.Build(), flags: MessageFlags.SuppressNotification); + await weeklyScheduleChannel.SendMessageAsync(embed: embed.Build()); _logger.LogInformation("Finished posting weekly schedule"); }