Skip to content

Commit

Permalink
Fix condition to check if date field
Browse files Browse the repository at this point in the history
Signed-off-by: Rupal Mahajan <[email protected]>
  • Loading branch information
rupal-bq committed Feb 18, 2024
1 parent 0453721 commit d493e8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/routes/utils/dataReportHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export const getOpenSearchData = (
if (typeof dateValue === 'string') {
data._source[keys] = moment.utc(dateValue).tz(timezone).format(dateFormat);
} else if (
fieldDateValue.length !== 0 &&
fieldDateValue instanceof Array
dateValue.length !== 0 &&
dateValue instanceof Array
) {
fieldDateValue.forEach((element, index) => {
data._source[keys][index] = moment.utc(element).tz(timezone).format(dateFormat);
Expand All @@ -161,8 +161,8 @@ export const getOpenSearchData = (
if (typeof fieldDateValue === 'string') {
keys.push(moment.utc(fieldDateValue).tz(timezone).format(dateFormat));
} else if (
fieldDateValue.length !== 0 &&
fieldDateValue instanceof Array
dateValue.length !== 0 &&
dateValue instanceof Array
) {
let tempArray: string[] = [];
fieldDateValue.forEach((index) => {
Expand Down

0 comments on commit d493e8e

Please sign in to comment.