mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 11:22:55 +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:
commit
a8b301c618
@ -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