Add GetShortHumanReadable for TimeSpan

This commit is contained in:
Mira 2022-08-22 17:37:51 +02:00
parent 3f2599171e
commit eaa5b1a177
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36

View file

@ -494,6 +494,9 @@ public static class UniversalExtensions
public static string GetShortHumanReadable(this long seconds, TimeFormat timeFormat = TimeFormat.DAYS) => public static string GetShortHumanReadable(this long seconds, TimeFormat timeFormat = TimeFormat.DAYS) =>
TimeSpan.FromSeconds(seconds).GetShortTimeFormat(timeFormat); TimeSpan.FromSeconds(seconds).GetShortTimeFormat(timeFormat);
public static string GetShortHumanReadable(this TimeSpan timespan, TimeFormat timeFormat = TimeFormat.DAYS) =>
timespan.GetShortTimeFormat(timeFormat);
/// <summary> /// <summary>