fix: don't render invalid dated cycles and modules
This commit is contained in:
parent
0dd336aec8
commit
c5612ee7a3
2 changed files with 7 additions and 2 deletions
|
|
@ -63,7 +63,9 @@ export const CyclesListGanttChartView: FC<Props> = ({ cycles, mutateCycles }) =>
|
|||
const blockFormat = (blocks: ICycle[]) =>
|
||||
blocks && blocks.length > 0
|
||||
? blocks
|
||||
.filter((b) => b.start_date && b.end_date)
|
||||
.filter(
|
||||
(b) => b.start_date && b.end_date && new Date(b.start_date) <= new Date(b.end_date)
|
||||
)
|
||||
.map((block) => ({
|
||||
data: block,
|
||||
id: block.id,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,10 @@ export const ModulesListGanttChartView: FC<Props> = ({ modules, mutateModules })
|
|||
const blockFormat = (blocks: IModule[]) =>
|
||||
blocks && blocks.length > 0
|
||||
? blocks
|
||||
.filter((b) => b.start_date && b.target_date)
|
||||
.filter(
|
||||
(b) =>
|
||||
b.start_date && b.target_date && new Date(b.start_date) <= new Date(b.target_date)
|
||||
)
|
||||
.map((block) => ({
|
||||
data: block,
|
||||
id: block.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue