mirror of https://github.com/ppy/osu
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 @@ public static LocalisableString ToFormattedDuration(this TimeSpan timeSpan)
|
|||
/// <returns>A short relative string representing the input time.</returns>
|
||||
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 "-";
|
||||
|
||||
var now = DateTime.Now;
|
||||
|
|
Loading…
Reference in New Issue