From 6edf3f1ae9853d201240538cd27b04b31e5fe732 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Mon, 23 Jan 2023 21:23:02 -0600 Subject: [PATCH] fix issue with default date and default order on advanced search --- .../Views/Shared/Partials/_SearchResourceFilter.cshtml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/WebfrontCore/Views/Shared/Partials/_SearchResourceFilter.cshtml b/WebfrontCore/Views/Shared/Partials/_SearchResourceFilter.cshtml index 63a3454e8..e7d36ce77 100644 --- a/WebfrontCore/Views/Shared/Partials/_SearchResourceFilter.cshtml +++ b/WebfrontCore/Views/Shared/Partials/_SearchResourceFilter.cshtml @@ -2,6 +2,7 @@ @using SharedLibraryCore.Dtos @using WebfrontCore.QueryHelpers.Models @using Data.Models +@using System.Globalization @model string @{ var existingClientFilter = ViewBag.ClientResourceRequest as ClientResourceRequest; @@ -97,14 +98,14 @@
- @{ var oneYearAgo = DateTime.UtcNow.AddYears(-1).ToShortDateString(); } + @{ var presetDate = (existingClientFilter?.ClientConnected ?? DateTime.UtcNow.AddYears(-1)).ToString("s", CultureInfo.InvariantCulture); } + id="clientConnected@(Model)" data-date="@presetDate" + value="@presetDate"/>
- @if (existingClientFilter?.Direction is SortDirection.Descending) + @if ((existingClientFilter?.Direction ?? SortDirection.Descending) is SortDirection.Descending) {