From eaa5b1a1772d518786365e5ac4dd37c0bace0851 Mon Sep 17 00:00:00 2001 From: Mira <56395159+TheXorog@users.noreply.github.com> Date: Mon, 22 Aug 2022 17:37:51 +0200 Subject: [PATCH] Add GetShortHumanReadable for TimeSpan --- UniversalExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UniversalExtensions.cs b/UniversalExtensions.cs index 506174e..4e9862a 100644 --- a/UniversalExtensions.cs +++ b/UniversalExtensions.cs @@ -494,6 +494,9 @@ public static class UniversalExtensions public static string GetShortHumanReadable(this long seconds, TimeFormat timeFormat = TimeFormat.DAYS) => TimeSpan.FromSeconds(seconds).GetShortTimeFormat(timeFormat); + public static string GetShortHumanReadable(this TimeSpan timespan, TimeFormat timeFormat = TimeFormat.DAYS) => + timespan.GetShortTimeFormat(timeFormat); + ///