Fixed date sorter for dates in Cluster info table

This commit is contained in:
KharchenkoVV 2021-08-31 16:53:46 +05:00
parent a21e528f55
commit 22c242cd5e

View File

@ -6,8 +6,9 @@ import { LineChartOutlined, ProfileOutlined } from "@ant-design/icons";
import {
makeTextColumn,
makeGroupColumn,
makeNumericColumn,
makeNumericColumnPlanFact
makeColumn,
makeNumericColumnPlanFact,
makeDateSorter
} from "../../components/Table";
import { calcAndUpdateStatsBySections, makeFilterMinMaxFunction } from "./functions";
import { invokeWebApiWrapperAsync } from '../../components/factory';
@ -128,8 +129,22 @@ export default function ClusterWells({ clusterData }) {
(text) => text ?? '-'
),
makeGroupColumn("Фактические сроки", [
makeNumericColumn("начало", "factStart", null, null, (dateString) => !Number.isNaN(new Date(dateString).getTime()) ? new Date(dateString).toLocaleString() : '-'),
makeNumericColumn("окончание", "factEnd", null, null, (dateString) => !Number.isNaN(new Date(dateString).getTime()) ? new Date(dateString).toLocaleString() : '-'),
makeColumn("начало", "factStart",
{
sorter: makeDateSorter('factStart'),
render: (dateString) => !Number.isNaN(new Date(dateString).getTime())
? new Date(dateString).toLocaleString()
: '-'
}
),
makeColumn("окончание", "factEnd",
{
sorter: makeDateSorter('factEnd'),
render: (dateString) => !Number.isNaN(new Date(dateString).getTime())
? new Date(dateString).toLocaleString()
: '-'
}
),
]),
makeNumericColumnPlanFact(
"Продолжительность",