From 76b25a716ca0afebadc299a4d2b58f7c05f8e4b0 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 26 Jan 2024 17:46:37 -0500 Subject: [PATCH] - updates from lifecyle component. Signed-off-by: Dave Richer --- .../components/job-lifecycle/job-lifecycle.component.jsx | 6 +++--- client/src/pages/jobs-detail/jobs-detail.page.component.jsx | 2 +- client/src/utils/DateFormatter.jsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/components/job-lifecycle/job-lifecycle.component.jsx b/client/src/components/job-lifecycle/job-lifecycle.component.jsx index 42bf53827..8f6b4e709 100644 --- a/client/src/components/job-lifecycle/job-lifecycle.component.jsx +++ b/client/src/components/job-lifecycle/job-lifecycle.component.jsx @@ -1,5 +1,5 @@ import React, {useCallback, useEffect, useState} from 'react'; -import moment from "moment"; +import day from '../../utils/day'; import axios from 'axios'; import {Badge, Card, Space, Table, Tag} from 'antd'; import {gql, useQuery} from "@apollo/client"; @@ -69,7 +69,7 @@ export function JobLifecycleComponent({job, statuses, ...rest}) { dataIndex: 'start', key: 'start', render: (text) => DateTimeFormatterFunction(text), - sorter: (a, b) => moment(a.start).unix() - moment(b.start).unix(), + sorter: (a, b) => day(a.start).unix() - day(b.start).unix(), }, { title: t('job_lifecycle.columns.relative_start'), @@ -87,7 +87,7 @@ export function JobLifecycleComponent({job, statuses, ...rest}) { } return isEmpty(a.end) ? 1 : -1; } - return moment(a.end).unix() - moment(b.end).unix(); + return day(a.end).unix() - day(b.end).unix(); }, render: (text) => isEmpty(text) ? t('job_lifecycle.content.not_available') : DateTimeFormatterFunction(text) }, diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index af101035d..32d5bba7a 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -310,7 +310,7 @@ export function JobsDetailPage({ key: 'lifecycle', icon: , label: t('menus.jobsdetail.lifecycle'), - children: {t('menus.jobsdetail.lifecycle')} + children: , }, { key: "dates", diff --git a/client/src/utils/DateFormatter.jsx b/client/src/utils/DateFormatter.jsx index 1ae2c9ba1..8024db69a 100644 --- a/client/src/utils/DateFormatter.jsx +++ b/client/src/utils/DateFormatter.jsx @@ -18,7 +18,7 @@ export function DateTimeFormatter(props) { : null; } export function DateTimeFormatterFunction(date) { - return moment(date).format("MM/DD/YYYY hh:mm a"); + return dayjs(date).format("MM/DD/YYYY hh:mm a"); } export function TimeFormatter(props) { return props.children