diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index b725f46e76..cf0a0fee37 100644 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -12,14 +12,14 @@ namespace osu.Game.Graphics { public class DrawableDate : OsuSpriteText, IHasTooltip { - private readonly DateTimeOffset date; + protected readonly DateTimeOffset Date; public DrawableDate(DateTimeOffset date) { AutoSizeAxes = Axes.Both; Font = "Exo2.0-RegularItalic"; - this.date = date.ToLocalTime(); + this.Date = date.ToLocalTime(); } [BackgroundDependencyLoader] @@ -38,7 +38,7 @@ namespace osu.Game.Graphics { updateTime(); - var diffToNow = DateTimeOffset.Now.Subtract(date); + var diffToNow = DateTimeOffset.Now.Subtract(Date); double timeUntilNextUpdate = 1000; if (diffToNow.TotalSeconds > 60) @@ -58,10 +58,10 @@ namespace osu.Game.Graphics public override bool HandleMouseInput => true; - protected virtual string Format() => date.Humanize(); + protected virtual string Format() => Date.Humanize(); private void updateTime() => Text = Format(); - public virtual string TooltipText => string.Format($"{date:MMMM d, yyyy h:mm tt \"UTC\"z}"); + public virtual string TooltipText => string.Format($"{Date:MMMM d, yyyy h:mm tt \"UTC\"z}"); } } diff --git a/osu.Game/Graphics/DrawableJoinDate.cs b/osu.Game/Graphics/DrawableJoinDate.cs index 763aea60ba..a0d28406d3 100644 --- a/osu.Game/Graphics/DrawableJoinDate.cs +++ b/osu.Game/Graphics/DrawableJoinDate.cs @@ -7,17 +7,13 @@ namespace osu.Game.Graphics { public class DrawableJoinDate : DrawableDate { - private readonly DateTimeOffset date; - - public DrawableJoinDate(DateTimeOffset date) : base(date) + public DrawableJoinDate(DateTimeOffset date) + : base(date) { - this.date = date; } - protected override string Format() => Text = date.ToUniversalTime().Year < 2008 ? - "Here since the beginning" : - string.Format($"{date:MMMM yyyy}"); + protected override string Format() => Text = Date.ToUniversalTime().Year < 2008 ? "Here since the beginning" : $"{Date:MMMM yyyy}"; - public override string TooltipText => string.Format($"{date:MMMM d, yyyy}"); + public override string TooltipText => $"{Date:MMMM d, yyyy}"; } }