From eb1a80fb737fafcdb012281e3c7d28e8bef3ec49 Mon Sep 17 00:00:00 2001 From: Antonin Date: Mon, 1 Jul 2024 11:32:29 +0200 Subject: [PATCH] feat:hide oudated rounds (#3047) --- .../Components/MandatePersonCard/MandatePersonCard.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Procurations/Components/MandantTab/Components/MandatePersonCard/MandatePersonCard.tsx b/src/components/Procurations/Components/MandantTab/Components/MandatePersonCard/MandatePersonCard.tsx index 7128cdeac..60a287fd9 100644 --- a/src/components/Procurations/Components/MandantTab/Components/MandatePersonCard/MandatePersonCard.tsx +++ b/src/components/Procurations/Components/MandantTab/Components/MandatePersonCard/MandatePersonCard.tsx @@ -26,6 +26,7 @@ import { VoteZoneModel, } from '~/api/Procuration/procuration.model' import { getHumanFormattedDate, getHumanFormattedTime } from '~/utils/date' +import { isPast } from 'date-fns' export interface MandatePersonCardProps { firstName: string @@ -70,7 +71,9 @@ export enum MandatePersonCardType { export default function MandatePersonCard(props: MandatePersonCardProps) { const linkedPeople = props.linkedPeople - ? props.linkedPeople.map(x => ({ ...x, proxy: x.proxy ?? x.request ? [x.proxy ?? x.request] : [] })) + ? props.linkedPeople + .filter(x => (x.round?.date ? !isPast(new Date(x.round?.date)) : true)) + .map(x => ({ ...x, proxy: x.proxy ?? x.request ? [x.proxy ?? x.request] : [] })) : undefined return (