From 0111da10fb4ce5b72740a64b4d174166d8b00e27 Mon Sep 17 00:00:00 2001 From: zsbrown97 Date: Thu, 25 Apr 2024 16:03:18 -0500 Subject: [PATCH 1/2] added one day to reported to filter Signed-off-by: zsbrown97 --- frontend/src/routes/issues/table/+layout.svelte | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/issues/table/+layout.svelte b/frontend/src/routes/issues/table/+layout.svelte index 964de8c7..c5722f06 100644 --- a/frontend/src/routes/issues/table/+layout.svelte +++ b/frontend/src/routes/issues/table/+layout.svelte @@ -124,13 +124,25 @@ startDate: Date, endDate: Date ) { + // Sets endDate to be one day later than what's selected to play nicely with STWUI + const oneDayInMilliseconds = 24 * 60 * 60 * 1000; // Number of milliseconds in one day + let nextEndDate; + + if (endDate == undefined) { + nextEndDate = endDate; + } else { + nextEndDate = new Date(endDate.getTime() + oneDayInMilliseconds); + } + + // console.log(endDate); + ctx.applyServiceRequestParams( { servicePriority: selectedServicePriority, serviceCode: selectedServiceCodes?.map((s) => Number(s)), status: statusInput, startDate: startDate?.toISOString(), - endDate: endDate?.toISOString() + endDate: nextEndDate?.toISOString() }, $page.url ); @@ -152,7 +164,7 @@
{#if !isSearchFiltersOpen} From c1018d91f03fe6e2177211ab350cd9237121eea9 Mon Sep 17 00:00:00 2001 From: zsbrown97 Date: Thu, 25 Apr 2024 16:09:14 -0500 Subject: [PATCH 2/2] refactored logic, checked formatting Signed-off-by: zsbrown97 --- frontend/src/routes/issues/table/+layout.svelte | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/frontend/src/routes/issues/table/+layout.svelte b/frontend/src/routes/issues/table/+layout.svelte index c5722f06..51a40907 100644 --- a/frontend/src/routes/issues/table/+layout.svelte +++ b/frontend/src/routes/issues/table/+layout.svelte @@ -126,23 +126,18 @@ ) { // Sets endDate to be one day later than what's selected to play nicely with STWUI const oneDayInMilliseconds = 24 * 60 * 60 * 1000; // Number of milliseconds in one day - let nextEndDate; - if (endDate == undefined) { - nextEndDate = endDate; - } else { - nextEndDate = new Date(endDate.getTime() + oneDayInMilliseconds); + if (endDate != undefined) { + endDate = new Date(endDate.getTime() + oneDayInMilliseconds); } - // console.log(endDate); - ctx.applyServiceRequestParams( { servicePriority: selectedServicePriority, serviceCode: selectedServiceCodes?.map((s) => Number(s)), status: statusInput, startDate: startDate?.toISOString(), - endDate: nextEndDate?.toISOString() + endDate: endDate?.toISOString() }, $page.url ); @@ -164,7 +159,7 @@
{#if !isSearchFiltersOpen}