mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Update TimeSpan
localisation to use ToLocalisableString
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
@ -42,12 +43,12 @@ namespace osu.Game.Extensions
|
|||||||
public static LocalisableString ToFormattedDuration(this TimeSpan timeSpan)
|
public static LocalisableString ToFormattedDuration(this TimeSpan timeSpan)
|
||||||
{
|
{
|
||||||
if (timeSpan.TotalDays >= 1)
|
if (timeSpan.TotalDays >= 1)
|
||||||
return new LocalisableFormattableString(timeSpan, @"dd\:hh\:mm\:ss");
|
return timeSpan.ToLocalisableString(@"dd\:hh\:mm\:ss");
|
||||||
|
|
||||||
if (timeSpan.TotalHours >= 1)
|
if (timeSpan.TotalHours >= 1)
|
||||||
return new LocalisableFormattableString(timeSpan, @"hh\:mm\:ss");
|
return timeSpan.ToLocalisableString(@"hh\:mm\:ss");
|
||||||
|
|
||||||
return new LocalisableFormattableString(timeSpan, @"mm\:ss");
|
return timeSpan.ToLocalisableString(@"mm\:ss");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user