refactor: assert entry dates as string

This commit is contained in:
Ali BARIN
2023-10-26 15:40:11 +00:00
parent 3549fef71c
commit 9f8eb985e4
2 changed files with 8 additions and 4 deletions

View File

@@ -39,11 +39,15 @@ function ExecutionId(props: Pick<IExecution, 'id'>) {
}
function ExecutionDate(props: Pick<IExecution, 'createdAt'>) {
const createdAt = DateTime.fromMillis(parseInt(props.createdAt, 10));
const createdAt = DateTime.fromMillis(
parseInt(props.createdAt as string, 10)
);
const relativeCreatedAt = createdAt.toRelative();
return (
<Tooltip title={createdAt.toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)}>
<Tooltip
title={createdAt.toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)}
>
<Typography variant="body1" gutterBottom>
{relativeCreatedAt}
</Typography>

View File

@@ -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();