Add a fallback for humanizer localization failure

This commit is contained in:
David Zhao
2019-07-30 13:58:08 +09:00
parent 6f2edaad55
commit 1956098166
3 changed files with 40 additions and 4 deletions

View File

@ -2,11 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics.Sprites;
using osu.Game.Utils;
namespace osu.Game.Graphics
{
@ -71,7 +71,7 @@ namespace osu.Game.Graphics
Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate);
}
protected virtual string Format() => Date.Humanize();
protected virtual string Format() => HumanizerUtils.Humanize(Date);
private void updateTime() => Text = Format();