mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-31 03:44:29 +01:00
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 <nicolas.dorier@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,11 @@
|
||||
{
|
||||
<span text-translate="true">7 Days</span>
|
||||
}
|
||||
else if (HasArrayFilter("startdate", "alltime"))
|
||||
{
|
||||
<span text-translate="true">All Time</span>
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
<span text-translate="true">Custom</span>
|
||||
@@ -264,6 +269,7 @@
|
||||
<a asp-action="ListInvoices" asp-route-storeId="@Model.StoreId" asp-route-count="@Model.Count" asp-route-searchTerm="@Model.Search.Toggle("startdate", "-1d")" class="dropdown-item @(HasArrayFilter("startdate", "-1d") ? "custom-active" : "")" text-translate="true">Last 24 hours</a>
|
||||
<a asp-action="ListInvoices" asp-route-storeId="@Model.StoreId" asp-route-count="@Model.Count" asp-route-searchTerm="@Model.Search.Toggle("startdate", "-3d")" class="dropdown-item @(HasArrayFilter("startdate", "-3d") ? "custom-active" : "")" text-translate="true">Last 3 days</a>
|
||||
<a asp-action="ListInvoices" asp-route-storeId="@Model.StoreId" asp-route-count="@Model.Count" asp-route-searchTerm="@Model.Search.Toggle("startdate", "-7d")" class="dropdown-item @(HasArrayFilter("startdate", "-7d") ? "custom-active" : "")" text-translate="true">Last 7 days</a>
|
||||
<a asp-action="ListInvoices" asp-route-storeId="@Model.StoreId" asp-route-count="@Model.Count" asp-route-searchTerm="@Model.Search.Toggle("startdate", "alltime")" class="dropdown-item @(HasArrayFilter("startdate", "alltime") || !Model.Search.ContainsFilter("startdate") ? "custom-active" : "")" text-translate="true">All Time</a>
|
||||
<button type="button" class="dropdown-item @(HasCustomDateFilter() ? "custom-active" : "")" data-bs-toggle="modal" data-bs-target="#customRangeModal" text-translate="true">Custom Range</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user