diff --git a/public/components/common/query_utils/index.ts b/public/components/common/query_utils/index.ts index 489afad13..73e137bc1 100644 --- a/public/components/common/query_utils/index.ts +++ b/public/components/common/query_utils/index.ts @@ -74,7 +74,7 @@ export const convertDateTime = ( const epochTime = myDate.getTime() / 1000.0; return Math.round(epochTime); } - if (formatted) return returnTime!.utc().format(PPL_DATE_FORMAT); + if (formatted) return returnTime?.utc()?.format(PPL_DATE_FORMAT); return returnTime; }; diff --git a/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap b/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap index a149d56be..50d7f2081 100644 --- a/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap +++ b/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap @@ -72,6 +72,6 @@ exports[` spec renders visualization outputs 1`] = ` class="euiText euiText--small" style="margin-left: 9px;" > - 2020-07-21T18:37:44+00:00 - 2020-08-20T18:37:44+00:00 + 2020-07-21 18:37:44.710000 - 2020-07-21 18:37:44.710000 `; diff --git a/public/components/notebooks/components/paragraph_components/para_output.tsx b/public/components/notebooks/components/paragraph_components/para_output.tsx index 1202682f7..ef3dc4097 100644 --- a/public/components/notebooks/components/paragraph_components/para_output.tsx +++ b/public/components/notebooks/components/paragraph_components/para_output.tsx @@ -103,7 +103,6 @@ const OutputBody = ({ const to = convertDateTime(visInput?.timeRange?.from, false, false); const displayFrom = convertDateTime(visInput?.timeRange?.from, true) || 'Invalid date'; const displayTo = convertDateTime(visInput?.timeRange?.from, false) || 'Invalid date'; - console.log('display', { displayFrom, displayTo, from, to, dateFormat }); if (typeOut !== undefined) { switch (typeOut) { case 'QUERY':