From 7c90ab2e48367cec066f86ea790ae72936193d04 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Fri, 9 Sep 2022 09:36:10 +0200 Subject: [PATCH] Don't display relative time in the future on background jobs screen --- .../routes/settings/settings-background-jobs/JobList.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/front/src/routes/settings/settings-background-jobs/JobList.jsx b/front/src/routes/settings/settings-background-jobs/JobList.jsx index 57d20b3e4c..8cb6dd0b39 100644 --- a/front/src/routes/settings/settings-background-jobs/JobList.jsx +++ b/front/src/routes/settings/settings-background-jobs/JobList.jsx @@ -1,12 +1,9 @@ import { Text } from 'preact-i18n'; import cx from 'classnames'; -import dayjs from 'dayjs'; -import relativeTime from 'dayjs/plugin/relativeTime'; import { JOB_STATUS, JOB_ERROR_TYPES } from '../../../../../server/utils/constants'; +import RelativeTime from '../../../components/device/RelativeTime'; import style from './style.css'; -dayjs.extend(relativeTime); - const JobList = ({ children, ...props }) => (
@@ -40,9 +37,7 @@ const JobList = ({ children, ...props }) => (
- {dayjs(job.created_at) - .locale(props.user.language) - .fromNow()} +
{job.data && job.data.error_type && job.data.error_type !== JOB_ERROR_TYPES.UNKNOWN_ERROR && (