1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Convert to Local Time in Date Tooltip

This commit is contained in:
Imad Dodin 2021-12-15 21:34:59 -08:00
parent 0ec1e1e2d5
commit b3e83a47a4
2 changed files with 5 additions and 3 deletions

View File

@ -65,8 +65,10 @@ namespace osu.Game.Graphics
public void SetContent(DateTimeOffset date) public void SetContent(DateTimeOffset date)
{ {
dateText.Text = $"{date:d MMMM yyyy} "; DateTimeOffset localDate = date.ToLocalTime();
timeText.Text = $"{date:HH:mm:ss \"UTC\"z}";
dateText.Text = $"{localDate:d MMMM yyyy} ";
timeText.Text = $"{localDate:HH:mm:ss \"UTC\"z}";
} }
public void Move(Vector2 pos) => Position = pos; public void Move(Vector2 pos) => Position = pos;

View File

@ -22,7 +22,7 @@ namespace osu.Game.Graphics
if (date == value) if (date == value)
return; return;
date = value.ToLocalTime(); date = value;
if (LoadState >= LoadState.Ready) if (LoadState >= LoadState.Ready)
updateTime(); updateTime();