1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Merge pull request #26526 from bdach/fix-date-display-failing

Fix date failing to display on leaderboard for some scores with weird datetimes
This commit is contained in:
Dean Herbert 2024-01-14 22:56:32 +09:00 committed by GitHub
commit a8b301c618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,8 @@ namespace osu.Game.Extensions
/// <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;