diff --git a/spiffworkflow-frontend/src/components/TableCellWithTimeAgoInWords.tsx b/spiffworkflow-frontend/src/components/TableCellWithTimeAgoInWords.tsx new file mode 100644 index 000000000..754c37fb5 --- /dev/null +++ b/spiffworkflow-frontend/src/components/TableCellWithTimeAgoInWords.tsx @@ -0,0 +1,17 @@ +// @ts-ignore +import { TimeAgo } from '../helpers/timeago'; +import { convertSecondsToFormattedDateTime } from '../helpers'; + +type OwnProps = { + time_in_seconds: number; +}; + +export default function TableCellWithTimeAgoInWords({ + time_in_seconds, +}: OwnProps) { + return ( + + {time_in_seconds ? TimeAgo.inWords(time_in_seconds) : '-'} + + ); +} diff --git a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx index 95e082e72..05121c861 100644 --- a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx +++ b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx @@ -10,6 +10,7 @@ import { } from '../helpers'; import HttpService from '../services/HttpService'; import { PaginationObject } from '../interfaces'; +import TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords'; const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5; const paginationQueryParamPrefix = 'tasks_for_my_open_processes'; @@ -73,11 +74,9 @@ export default function MyOpenProcesses() { rowToUse.created_at_in_seconds ) || '-'} - - {convertSecondsToFormattedDateTime( - rowToUse.updated_at_in_seconds - ) || '-'} - +