Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32957 ECL Watch ZAP dialog invalid date formats #19278

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion esp/src/eclwatch/WUDetailsWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}
Expand Down
2 changes: 1 addition & 1 deletion esp/src/eclwatch/templates/WUDetailsWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h2>
<input id="${id}EndDateTime" name="LogFilter_AbsoluteTimeRange_EndDate" type="hidden" />
<input id="${id}EndDate" title="${i18n.ToDate}:" name="EndDate" data-dojo-props="trim: true" required="required" data-dojo-type="dijit.form.DateTextBox" />
<input id="${id}EndTime" title="" name="EndTime" data-dojo-props="trim: true" value="T19:30:00" data-dojo-type="dijit.form.TimeTextBox" />
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" colspan="2" data-dojo-type="dijit.form.TextBox" />
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" value="43200" colspan="2" data-dojo-type="dijit.form.TextBox" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is 43200 representing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the default that ESP sets, got added to the v9 UI a couple weeks ago, but not to the v5 version (added a comment on that PR, https://github.com/hpcc-systems/HPCC-Platform/pull/19216/files)

<input id="${id}LineLimit" title="${i18n.LogLineLimit}" name="LogFilter_LineLimit" colspan="2" value="10000" data-dojo-type="dijit.form.TextBox" />
<input id="${id}LineStartFrom" title="${i18n.LogLineStartFrom}" name="LogFilter_LineStartFrom" value="0" colspan="2" data-dojo-type="dijit.form.TextBox" />
<select id="${id}SelectColumnMode" title="${i18n.ColumnMode}" name="LogFilter_SelectColumnMode" colspan="2" data-dojo-type="dijit.form.Select">
Expand Down
11 changes: 6 additions & 5 deletions esp/src/src-react/components/forms/ZAPDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,12 @@ export const ZAPDialog: React.FunctionComponent<ZAPDialogProps> = ({
}
for (const key in logFilter) {
if (key === "AbsoluteTimeRange") {
const startDate = logFilter.AbsoluteTimeRange.StartDate ? new Date(logFilter.AbsoluteTimeRange.StartDate).toISOString() : "";
const endDate = logFilter.AbsoluteTimeRange.EndDate ? new Date(logFilter.AbsoluteTimeRange.EndDate).toISOString() : "";
if (startDate && endDate) {
formData.append("LogFilter_AbsoluteTimeRange_StartDate", startDate);
formData.append("LogFilter_AbsoluteTimeRange_EndDate", endDate);
const startDate = logFilter.AbsoluteTimeRange.StartDate ? new Date(logFilter.AbsoluteTimeRange.StartDate) : null;
let endDate = logFilter.AbsoluteTimeRange.EndDate ? new Date(logFilter.AbsoluteTimeRange.EndDate) : null;
if (startDate) {
endDate = endDate === null ? new Date(startDate.getTime() + (8 * 3600 * 1000)) : endDate;
formData.append("LogFilter_AbsoluteTimeRange_StartDate", startDate.toISOString());
formData.append("LogFilter_AbsoluteTimeRange_EndDate", endDate.toISOString());
delete logFilter.RelativeTimeRangeBuffer;
}
} else {
Expand Down
Loading