- updates from lifecyle component.
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
@@ -310,7 +310,7 @@ export function JobsDetailPage({
|
||||
key: 'lifecycle',
|
||||
icon: <BarsOutlined />,
|
||||
label: t('menus.jobsdetail.lifecycle'),
|
||||
children: <span><BarsOutlined />{t('menus.jobsdetail.lifecycle')}</span>
|
||||
children: <JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />,
|
||||
},
|
||||
{
|
||||
key: "dates",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user