mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Apply the format fix to the tooltip text across the board
This commit is contained in:
@ -14,20 +14,16 @@ namespace osu.Game.Graphics
|
|||||||
{
|
{
|
||||||
private readonly DateTimeOffset date;
|
private readonly DateTimeOffset date;
|
||||||
private readonly string dateFormat;
|
private readonly string dateFormat;
|
||||||
private readonly string tooltipFormat;
|
|
||||||
|
|
||||||
/// <param name="dateFormat">The string to format the date text with.
|
/// <param name="dateFormat">The string to format the date text with.
|
||||||
/// May be null if the humanized format should be used.</param>
|
/// May be null if the humanized format should be used.</param>
|
||||||
/// <param name="tooltipFormat">The string to format the tooltip text with.
|
public DrawableDate(DateTimeOffset date, string dateFormat = null)
|
||||||
/// May be null if the default format should be used.</param>
|
|
||||||
public DrawableDate(DateTimeOffset date, string dateFormat = null, string tooltipFormat = null)
|
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Font = "Exo2.0-RegularItalic";
|
Font = "Exo2.0-RegularItalic";
|
||||||
|
|
||||||
this.date = date.ToLocalTime();
|
this.date = date.ToLocalTime();
|
||||||
this.dateFormat = dateFormat;
|
this.dateFormat = dateFormat;
|
||||||
this.tooltipFormat = tooltipFormat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -70,8 +66,6 @@ namespace osu.Game.Graphics
|
|||||||
date.Humanize() :
|
date.Humanize() :
|
||||||
string.Format(dateFormat, date);
|
string.Format(dateFormat, date);
|
||||||
|
|
||||||
public string TooltipText => string.IsNullOrEmpty(tooltipFormat) ?
|
public string TooltipText => string.Format("{0:d MMMM yyyy H:mm \"UTC\"z}", date);
|
||||||
date.ToString() :
|
|
||||||
string.Format(tooltipFormat, date);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,12 +364,12 @@ namespace osu.Game.Overlays.Profile
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
infoTextLeft.AddText("Joined ", lightText);
|
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.NewLine();
|
||||||
infoTextLeft.AddText("Last seen ", lightText);
|
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();
|
infoTextLeft.NewParagraph();
|
||||||
|
|
||||||
if (user.PlayStyle?.Length > 0)
|
if (user.PlayStyle?.Length > 0)
|
||||||
|
Reference in New Issue
Block a user