From 79c5ff9ed00407cd08498a348d408e22885967bf Mon Sep 17 00:00:00 2001 From: Jessica Zavaleta <30375384+jessmzp@users.noreply.github.com> Date: Mon, 23 Dec 2024 03:27:49 -0600 Subject: [PATCH] Add All time to the Time filter, PlanB Assignment (#6514) * Add All time to the Time filter, wip: Clear All funtionality * Update ListInvoices.cshtml * Cleanup commented code * Toggle on 'All Time' if there no startdate selected --------- Co-authored-by: nicolas.dorier --- BTCPayServer/SearchString.cs | 3 +++ BTCPayServer/Views/UIInvoice/ListInvoices.cshtml | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/BTCPayServer/SearchString.cs b/BTCPayServer/SearchString.cs index 03d9348f3..c2eb57fe1 100644 --- a/BTCPayServer/SearchString.cs +++ b/BTCPayServer/SearchString.cs @@ -127,6 +127,8 @@ namespace BTCPayServer return DateTimeOffset.UtcNow.AddDays(-3).AddMinutes(timezoneOffset); case "-7d": return DateTimeOffset.UtcNow.AddDays(-7).AddMinutes(timezoneOffset); + case "alltime": + return null; // No filtering by date, so return null } // default parsing logic @@ -155,5 +157,6 @@ namespace BTCPayServer var value = str.Trim().TrimStart(FilterSeparator).TrimEnd(FilterSeparator); return string.IsNullOrEmpty(value) ? " " : value; } + } } diff --git a/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml b/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml index 4685e40ca..41a518a54 100644 --- a/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml @@ -250,6 +250,11 @@ { 7 Days } + else if (HasArrayFilter("startdate", "alltime")) + { + All Time + } + else { Custom @@ -264,6 +269,7 @@ Last 24 hours Last 3 days Last 7 days + All Time