From 35517aa35a719c1e3c3856e6ee9764328b5787e4 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:11:06 -0500 Subject: [PATCH] HPCC-32957 ECL Watch ZAP dialog invalid date formats fixes an issue in both the v5 and v9 ECL Watch UIs, where in attemping to download a ZAP report the formatting of the date fields could be incorrect Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/eclwatch/WUDetailsWidget.js | 4 +++- esp/src/eclwatch/templates/WUDetailsWidget.html | 2 +- esp/src/src-react/components/forms/ZAPDialog.tsx | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/esp/src/eclwatch/WUDetailsWidget.js b/esp/src/eclwatch/WUDetailsWidget.js index a6d214c7697..24aa5eb0550 100644 --- a/esp/src/eclwatch/WUDetailsWidget.js +++ b/esp/src/eclwatch/WUDetailsWidget.js @@ -161,7 +161,9 @@ define([ formatLogFilterDateTime: function (dateField, timeField, dateTimeField) { if (dateField.value.toString() !== "Invalid Date") { const d = new Date(dateField.value); - const date = `${d.getFullYear()}-${(d.getMonth() < 9 ? "0" : "") + parseInt(d.getMonth() + 1, 10)}-${d.getDate()}`; + const month = d.getMonth() + 1; + const day = d.getDate(); + const date = `${d.getFullYear()}-${(month < 9 ? "0" : "") + month}-${(day < 9 ? "0" : "") + day}`; const time = timeField.value.toString().replace(/.*1970\s(\S+).*/, "$1"); dateTimeField.value = `${date}T${time}.000Z`; } diff --git a/esp/src/eclwatch/templates/WUDetailsWidget.html b/esp/src/eclwatch/templates/WUDetailsWidget.html index ef58752e1a6..cbc3ade4d7b 100644 --- a/esp/src/eclwatch/templates/WUDetailsWidget.html +++ b/esp/src/eclwatch/templates/WUDetailsWidget.html @@ -205,7 +205,7 @@

- +