mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
Merge branch 'vnext'
This commit is contained in:
@@ -7,6 +7,7 @@ public static class DateTimeEx
|
||||
|
||||
public static string AsShortTimespan(this TimeSpan timeSpan)
|
||||
{
|
||||
var totalSecondsInt = (int)timeSpan.TotalSeconds;
|
||||
var totalMinutesInt = (int)timeSpan.TotalMinutes;
|
||||
var totalHoursInt = (int)timeSpan.TotalHours;
|
||||
var totalDays = timeSpan.TotalDays;
|
||||
@@ -35,8 +36,8 @@ public static class DateTimeEx
|
||||
result += hours + "h ";
|
||||
if (minutes > 0)
|
||||
result += minutes + "m ";
|
||||
if (result is not { Length: >0})
|
||||
result = (int)timeSpan.TotalSeconds + "s";
|
||||
if (result is not { Length: >0} && totalSecondsInt > 0)
|
||||
result = totalSecondsInt + "s";
|
||||
if (result is not { Length: > 0 })
|
||||
result = (int)timeSpan.TotalMilliseconds + "ms";
|
||||
return result.TrimEnd();
|
||||
|
||||
Reference in New Issue
Block a user