forked from ddrilling/asb_cloud_front
Fixed null dates display (for stats table)
This commit is contained in:
parent
996065bd58
commit
ebcd1eebb5
@ -55,6 +55,13 @@ export default function ClusterWells({statsWells}) {
|
|||||||
if (!filtersWellsType.some((el) => el.text === well.wellType))
|
if (!filtersWellsType.some((el) => el.text === well.wellType))
|
||||||
filtersWellsType.push({ text: well.wellType, value: well.wellType,})
|
filtersWellsType.push({ text: well.wellType, value: well.wellType,})
|
||||||
|
|
||||||
|
let periodPlanValue = well.total?.plan?.start && well.total?.plan?.end
|
||||||
|
? (new Date(well.total?.plan?.end) - new Date(well.total?.plan?.start)) / DAY_IN_MS
|
||||||
|
: '-'
|
||||||
|
let periodFactValue = well.total?.fact?.start && well.total?.fact?.end
|
||||||
|
? (new Date(well.total?.fact?.end) - new Date(well.total?.fact?.start)) / DAY_IN_MS
|
||||||
|
: '-'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
key: well.caption,
|
key: well.caption,
|
||||||
id: well.id,
|
id: well.id,
|
||||||
@ -62,8 +69,8 @@ export default function ClusterWells({statsWells}) {
|
|||||||
wellType: well.wellType,
|
wellType: well.wellType,
|
||||||
factStart: well.total?.fact?.start,
|
factStart: well.total?.fact?.start,
|
||||||
factEnd: well.total?.fact?.end,
|
factEnd: well.total?.fact?.end,
|
||||||
periodPlan: (new Date(well.total?.plan?.end) - new Date(well.total?.plan?.start)) / DAY_IN_MS,
|
periodPlan: periodPlanValue,
|
||||||
periodFact: (new Date(well.total?.fact?.end) - new Date(well.total?.fact?.start)) / DAY_IN_MS,
|
periodFact: periodFactValue,
|
||||||
rateOfPenetrationPlan: well.total?.plan?.rop,
|
rateOfPenetrationPlan: well.total?.plan?.rop,
|
||||||
rateOfPenetrationFact: well.total?.fact?.rop,
|
rateOfPenetrationFact: well.total?.fact?.rop,
|
||||||
routeSpeedPlan: well.total?.plan?.routeSpeed,
|
routeSpeedPlan: well.total?.plan?.routeSpeed,
|
||||||
@ -91,7 +98,9 @@ export default function ClusterWells({statsWells}) {
|
|||||||
setTableData(data)
|
setTableData(data)
|
||||||
}, [statsWells])
|
}, [statsWells])
|
||||||
|
|
||||||
const getDate = (str) => Number.isNaN(+new Date(str)) ? '-' : new Date(str).toLocaleString()
|
const getDate = (str) => Number.isNaN(+new Date(str)) || +new Date(str) === 0
|
||||||
|
? '-'
|
||||||
|
: new Date(str).toLocaleString()
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
makeTextColumn('скв №', 'caption', null, null,
|
makeTextColumn('скв №', 'caption', null, null,
|
||||||
|
Loading…
Reference in New Issue
Block a user