From bfb1f425895489542fc1d23a586e44d49a44f54c Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:03:20 -0400 Subject: [PATCH] HPCC-32076 ECL Watch v9 fix Logs filter start date fix an issue where the "Start Date" filter param specified by the user was not being correctly set in the request sent to ESP Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/src-react/components/Logs.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esp/src/src-react/components/Logs.tsx b/esp/src/src-react/components/Logs.tsx index 10ee0a988be..911cf63b236 100644 --- a/esp/src/src-react/components/Logs.tsx +++ b/esp/src/src-react/components/Logs.tsx @@ -13,7 +13,7 @@ import { Filter } from "./forms/Filter"; import { Fields } from "./forms/Fields"; import { ShortVerticalDivider } from "./Common"; -const maximumTimeUntilRefresh = 8 * 60 * 60 * 1000; +const eightHours = 8 * 60 * 60 * 1000; const startTimeOffset = 1 * 60 * 60 * 1000; const endTimeOffset = 23 * 60 * 60 * 1000; const defaultStartDate = new Date(new Date().getTime() - startTimeOffset); @@ -115,8 +115,9 @@ export const Logs: React.FunctionComponent = ({ if (typeof filter.StartDate === "string") { filter.StartDate = new Date(filter.StartDate + ":00Z"); } - if (filter.StartDate && now.getTime() - filter.StartDate.getTime() > maximumTimeUntilRefresh) { - filter.StartDate = new Date(now.getTime() - startTimeOffset); + if (!filter.StartDate) { + //assign a reasonable default start date if one isn't set + filter.StartDate = new Date(now.getTime() - eightHours); } if (!filter.EndDate) { filter.EndDate = new Date(now.getTime() + endTimeOffset);