1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +08:00

Apply the format fix to the tooltip text across the board

This commit is contained in:
HoutarouOreki 2018-05-25 13:05:41 +02:00
parent 6d222a36b2
commit 961702aadf
2 changed files with 4 additions and 10 deletions

View File

@ -14,20 +14,16 @@ namespace osu.Game.Graphics
{
private readonly DateTimeOffset date;
private readonly string dateFormat;
private readonly string tooltipFormat;
/// <param name="dateFormat">The string to format the date text with.
/// May be null if the humanized format should be used.</param>
/// <param name="tooltipFormat">The string to format the tooltip text with.
/// May be null if the default format should be used.</param>
public DrawableDate(DateTimeOffset date, string dateFormat = null, string tooltipFormat = null)
public DrawableDate(DateTimeOffset date, string dateFormat = null)
{
AutoSizeAxes = Axes.Both;
Font = "Exo2.0-RegularItalic";
this.date = date.ToLocalTime();
this.dateFormat = dateFormat;
this.tooltipFormat = tooltipFormat;
}
[BackgroundDependencyLoader]
@ -70,8 +66,6 @@ namespace osu.Game.Graphics
date.Humanize() :
string.Format(dateFormat, date);
public string TooltipText => string.IsNullOrEmpty(tooltipFormat) ?
date.ToString() :
string.Format(tooltipFormat, date);
public string TooltipText => string.Format("{0:d MMMM yyyy H:mm \"UTC\"z}", date);
}
}

View File

@ -364,12 +364,12 @@ namespace osu.Game.Overlays.Profile
else
{
infoTextLeft.AddText("Joined ", lightText);
infoTextLeft.AddText(new DrawableDate(user.JoinDate, "{0:MMMM yyyy}", "{0:d MMMM yyyy}"), boldItalic);
infoTextLeft.AddText(new DrawableDate(user.JoinDate, "{0:MMMM yyyy}"), boldItalic);
}
infoTextLeft.NewLine();
infoTextLeft.AddText("Last seen ", lightText);
infoTextLeft.AddText(new DrawableDate(user.LastVisit, null, "{0:d MMMM yyyy H:mm \"UTC\"z}"), boldItalic);
infoTextLeft.AddText(new DrawableDate(user.LastVisit, null), boldItalic);
infoTextLeft.NewParagraph();
if (user.PlayStyle?.Length > 0)