Skip to content

Commit

Permalink
use local time instead of utc
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Sep 6, 2022
1 parent 7ab408c commit e6e33b6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions PartyPlanner/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,25 @@ 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();
ImGui.Text(ev.StartsAt.Humanize());
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();
Expand All @@ -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)));
Expand Down

0 comments on commit e6e33b6

Please sign in to comment.