Skip to content

Commit

Permalink
feat:hide oudated rounds (#3047)
Browse files Browse the repository at this point in the history
  • Loading branch information
OverGlass committed Jul 1, 2024
1 parent 5061013 commit eb1a80f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit eb1a80f

Please sign in to comment.