Skip to content

Commit

Permalink
Fix logging of Google Event summary local time.
Browse files Browse the repository at this point in the history
Log (R1) for series occurrence calendar item summary.
#2047
  • Loading branch information
phw198 committed Feb 6, 2025
1 parent 2fccc5b commit ed0d356
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/OutlookGoogleCalendarSync/Console/Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ public void UpdateWithError(String moreOutput, System.Exception ex, bool notifyB
private void logLinesSansHtml(String htmlOutput, Markup? markupPrefix = null, Boolean verbose = false) {
String tagsStripped = Regex.Replace(htmlOutput, "(</p>|<br/?>)", "\r\n");
tagsStripped = Regex.Replace(tagsStripped, "<span class='em em-repeat'></span>", "(R)");
tagsStripped = Regex.Replace(tagsStripped, "<span class='em em-repeat-one'></span>", "(R1)");
tagsStripped = Regex.Replace(tagsStripped, "<.*?>", String.Empty);
String[] logLines = tagsStripped.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (markupPrefix == Markup.warning)
Expand Down
4 changes: 2 additions & 2 deletions src/OutlookGoogleCalendarSync/Google/GoogleCalendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2209,8 +2209,8 @@ public static String GetEventSummary(Event ev, out String eventSummaryAnonymised
if (!onlyIfNotVerbose || onlyIfNotVerbose && !Settings.Instance.VerboseOutput) {
try {
if (ev.Start.DateTimeDateTimeOffset != null) {
System.DateTimeOffset gDate = (System.DateTimeOffset)ev.Start.DateTimeDateTimeOffset;
eventSummary += gDate.DateTime.ToShortDateString() + " " + gDate.DateTime.ToShortTimeString();
System.DateTime gDate = ev.Start.SafeDateTime();
eventSummary += gDate.ToShortDateString() + " " + gDate.ToShortTimeString();
} else
eventSummary += System.DateTime.Parse(ev.Start.Date).ToShortDateString();
if (ev.Recurrence != null)
Expand Down

0 comments on commit ed0d356

Please sign in to comment.