diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index e6e7e3520..151042737 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -36,28 +36,6 @@ namespace BTCPayServer { public static class Extensions { - public static string Prettify(this TimeSpan timeSpan) - { - if (timeSpan.TotalMinutes < 1) - { - return $"{(int)timeSpan.TotalSeconds} second{Plural((int)timeSpan.TotalSeconds)}"; - } - if (timeSpan.TotalHours < 1) - { - return $"{(int)timeSpan.TotalMinutes} minute{Plural((int)timeSpan.TotalMinutes)}"; - } - if (timeSpan.Days < 1) - { - return $"{(int)timeSpan.TotalHours} hour{Plural((int)timeSpan.TotalHours)}"; - } - return $"{(int)timeSpan.TotalDays} day{Plural((int)timeSpan.TotalDays)}"; - } - - private static string Plural(int totalDays) - { - return totalDays > 1 ? "s" : string.Empty; - } - public static string PrettyPrint(this TimeSpan expiration) { StringBuilder builder = new StringBuilder(); diff --git a/BTCPayServer/Views/Invoice/ListInvoices.cshtml b/BTCPayServer/Views/Invoice/ListInvoices.cshtml index e7bc473d9..724da6feb 100644 --- a/BTCPayServer/Views/Invoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/Invoice/ListInvoices.cshtml @@ -66,7 +66,7 @@ @foreach(var invoice in Model.Invoices) {
Quota period | -@Model.RateLimits.TotalPeriod.Prettify() | +@Model.RateLimits.TotalPeriod.TimeString() |
---|---|---|
Requests quota | @@ -48,7 +48,7 @@||
Quota reset in | -@Model.RateLimits.CounterReset.Prettify() | +@Model.RateLimits.CounterReset.TimeString() |