Skip to content

Commit

Permalink
HPCC-32586 ECL Watch v9 fix WU filter incorrect dates
Browse files Browse the repository at this point in the history
Fixes an issue with formatting dates submitted in filter query,
where a datetime is reencoded to UTC even if that had already happened.
Also corrects a problem on the Files list filter, where the EndDate was
being assigned the StartDate's value.

Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Sep 4, 2024
1 parent e8c2224 commit bb6eafb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion esp/src/src-react/components/Files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ function formatQuery(_filter): { [id: string]: any } {
delete filter.NotInSuperFiles;
delete filter.Indexes;
if (filter.StartDate) {
if (filter.StartDate.indexOf("Z") < 0) { filter.StartDate += ":00.000Z"; }
filter.StartDate = new Date(filter.StartDate).toISOString();
}
if (filter.EndDate) {
filter.EndDate = new Date(filter.StartDate).toISOString();
if (filter.EndDate.indexOf("Z") < 0) { filter.EndDate += ":00.000Z"; }
filter.EndDate = new Date(filter.EndDate).toISOString();
}
return filter;
}
Expand Down
2 changes: 2 additions & 0 deletions esp/src/src/ESPWorkunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ export function formatQuery(_filter): { [id: string]: any } {
delete filter.LastNDays;
} else {
if (filter.StartDate) {
if (filter.StartDate.indexOf("Z") < 0) { filter.StartDate += ":00.000Z"; }
filter.StartDate = new Date(filter.StartDate).toISOString();
}
if (filter.EndDate) {
if (filter.EndDate.indexOf("Z") < 0) { filter.EndDate += ":00.000Z"; }
filter.EndDate = new Date(filter.EndDate).toISOString();
}
}
Expand Down

0 comments on commit bb6eafb

Please sign in to comment.