From 9f8eb985e4b1b2980c9203e3c6962178c5cc562f Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 26 Oct 2023 15:40:11 +0000 Subject: [PATCH] refactor: assert entry dates as string --- packages/web/src/components/ExecutionHeader/index.tsx | 8 ++++++-- packages/web/src/components/FlowRow/index.tsx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/web/src/components/ExecutionHeader/index.tsx b/packages/web/src/components/ExecutionHeader/index.tsx index 15fde3e4..71745ffa 100644 --- a/packages/web/src/components/ExecutionHeader/index.tsx +++ b/packages/web/src/components/ExecutionHeader/index.tsx @@ -39,11 +39,15 @@ function ExecutionId(props: Pick) { } function ExecutionDate(props: Pick) { - const createdAt = DateTime.fromMillis(parseInt(props.createdAt, 10)); + const createdAt = DateTime.fromMillis( + parseInt(props.createdAt as string, 10) + ); const relativeCreatedAt = createdAt.toRelative(); return ( - + {relativeCreatedAt} diff --git a/packages/web/src/components/FlowRow/index.tsx b/packages/web/src/components/FlowRow/index.tsx index 0a6858e3..194f1869 100644 --- a/packages/web/src/components/FlowRow/index.tsx +++ b/packages/web/src/components/FlowRow/index.tsx @@ -65,8 +65,8 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement { setAnchorEl(contextButtonRef.current); }; - const createdAt = DateTime.fromMillis(parseInt(flow.createdAt, 10)); - const updatedAt = DateTime.fromMillis(parseInt(flow.updatedAt, 10)); + const createdAt = DateTime.fromMillis(parseInt(flow.createdAt as string, 10)); + const updatedAt = DateTime.fromMillis(parseInt(flow.updatedAt as string, 10)); const isUpdated = updatedAt > createdAt; const relativeCreatedAt = createdAt.toRelative(); const relativeUpdatedAt = updatedAt.toRelative();