diff --git a/web/components/cycles/gantt-chart/cycles-list-layout.tsx b/web/components/cycles/gantt-chart/cycles-list-layout.tsx index 9614ea447..41e7a5444 100644 --- a/web/components/cycles/gantt-chart/cycles-list-layout.tsx +++ b/web/components/cycles/gantt-chart/cycles-list-layout.tsx @@ -63,7 +63,9 @@ export const CyclesListGanttChartView: FC = ({ 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, diff --git a/web/components/modules/gantt-chart/modules-list-layout.tsx b/web/components/modules/gantt-chart/modules-list-layout.tsx index 08465ffa9..b8ebd0185 100644 --- a/web/components/modules/gantt-chart/modules-list-layout.tsx +++ b/web/components/modules/gantt-chart/modules-list-layout.tsx @@ -69,7 +69,10 @@ export const ModulesListGanttChartView: FC = ({ 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,