mirror of
https://github.com/ppy/osu.git
synced 2025-01-22 12:32:55 +08:00
Fix date failing to display on leaderboard for some scores with weird datetimes
Addresses https://github.com/ppy/osu/discussions/26517. The score reported has a datetime of 0001/1/1 05:00:00 AM. Bit of a dodge fix but maybe fine?
This commit is contained in:
parent
cfeab790b5
commit
baf3867e17
@ -59,7 +59,8 @@ namespace osu.Game.Extensions
|
|||||||
/// <returns>A short relative string representing the input time.</returns>
|
/// <returns>A short relative string representing the input time.</returns>
|
||||||
public static string ToShortRelativeTime(this DateTimeOffset time, TimeSpan lowerCutoff)
|
public static string ToShortRelativeTime(this DateTimeOffset time, TimeSpan lowerCutoff)
|
||||||
{
|
{
|
||||||
if (time == default)
|
// covers all `DateTimeOffset` instances with the date portion of 0001-01-01.
|
||||||
|
if (time.Date == default)
|
||||||
return "-";
|
return "-";
|
||||||
|
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
|
Loading…
Reference in New Issue
Block a user