From e6e33b65dca74a50733bceb041063ddcdaa9407a Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 6 Sep 2022 21:55:11 +0200 Subject: [PATCH] use local time instead of utc --- PartyPlanner/PluginUI.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PartyPlanner/PluginUI.cs b/PartyPlanner/PluginUI.cs index 59685bb..acc8305 100644 --- a/PartyPlanner/PluginUI.cs +++ b/PartyPlanner/PluginUI.cs @@ -212,6 +212,9 @@ public void DrawEventRow(Models.EventType ev, Models.ServerType serverType) ImGui.EndTooltip(); } + var startsAt = ev.StartsAt.ToLocalTime(); + var endsAt = ev.EndsAt.ToLocalTime(); + ImGui.TableNextColumn(); ImGui.TextWrapped(description); ImGui.TableNextColumn(); @@ -219,15 +222,15 @@ public void DrawEventRow(Models.EventType ev, Models.ServerType serverType) if (ImGui.IsItemHovered()) { ImGui.BeginTooltip(); - ImGui.SetTooltip(ev.StartsAt.ToString()); + ImGui.SetTooltip(startsAt.ToString()); ImGui.EndTooltip(); } ImGui.TableNextColumn(); - ImGui.Text(ev.EndsAt.Humanize()); + ImGui.Text(endsAt.Humanize()); if (ImGui.IsItemHovered()) { ImGui.BeginTooltip(); - ImGui.SetTooltip(ev.EndsAt.ToString()); + ImGui.SetTooltip(endsAt.ToString()); ImGui.EndTooltip(); } ImGui.TableNextRow(); @@ -248,7 +251,7 @@ public void DrawEventWindow() ImGui.TextColored(new Vector4(0.668f, 0.146f, 0.910f, 1.0f), eventDetails.Location); ImGui.Spacing(); ImGui.TextColored(new Vector4(0.156f, 0.665f, 0.920f, 1.0f), - string.Format("From {0} to {1}", eventDetails.StartsAt.ToString(), eventDetails.EndsAt.ToString())); + string.Format("From {0} to {1}", eventDetails.StartsAt.ToLocalTime().ToString(), eventDetails.EndsAt.ToLocalTime().ToString())); ImGui.Spacing(); ImGui.TextColored(new Vector4(0.0888f, 0.740f, 0.176f, 1.0f), string.Format("Tags: {0}", string.Join(", ", eventDetails.Tags)));