From bfa9efffd321b6db53396c7d6e32ecfd9b1ea43e Mon Sep 17 00:00:00 2001 From: Dhananjaya Rajasinghe Date: Fri, 17 Feb 2023 18:28:50 +0530 Subject: [PATCH] Fixing a minor issue in date auto generation Signed-off-by: Dhananjaya Rajasinghe --- .../SessionWindow/SessionTab/SessionManagement/FixForm.tsx | 4 +++- .../SessionTab/SessionManagement/FixHeaderForm.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixForm.tsx b/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixForm.tsx index 4445167..b150b8a 100644 --- a/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixForm.tsx +++ b/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixForm.tsx @@ -134,7 +134,9 @@ export class FixForm extends React.Component { case 'monthyear': case 'utcdateonly': case 'utctimeonly': - value = value?.toISOString(); + if (typeof value === "object") { + value = value?.toISOString(); + } break; } diff --git a/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixHeaderForm.tsx b/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixHeaderForm.tsx index 5f99308..c94701d 100644 --- a/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixHeaderForm.tsx +++ b/src/main-layout/SessionWindow/SessionTab/SessionManagement/FixHeaderForm.tsx @@ -57,13 +57,15 @@ export class FixHeaderForm extends React.Component property.indexOf(`${namePrefix}__${name}__${fieldIterationIndex}`) > -1) filteredProperties.forEach(property => { - let value = inputData[property] + let value = inputData[property]; switch (field.def.type.toLowerCase()) { case "utctimestamp": case 'monthyear': case 'utcdateonly': case 'utctimeonly': - value = value?.toISOString(); + if (typeof value === "object") { + value = value?.toISOString(); + } break; }