diff --git a/frontend/src/routes/sponsor/frontpage/index.tsx b/frontend/src/routes/sponsor/frontpage/index.tsx index feddce802ad856f8d4bf189caacb72b6898168f4..225481b539d3a7d3589651b0441addfb05383845 100644 --- a/frontend/src/routes/sponsor/frontpage/index.tsx +++ b/frontend/src/routes/sponsor/frontpage/index.tsx @@ -18,7 +18,8 @@ import Page from 'components/page' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' import { Guest, Role } from 'interfaces' -import format from 'date-fns/format' +import { isBefore, format } from 'date-fns' + import SponsorGuestButtons from '../../components/sponsorGuestButtons' interface GuestProps { @@ -43,7 +44,8 @@ const PersonLine = ({ cancelCallback, }: PersonLineProps) => { const [t, i18n] = useTranslation(['common']) - + const today = new Date() + today.setHours(0, 0, 0, 0) return ( <TableRow key={`${person.first} ${person.last}`} @@ -57,7 +59,7 @@ const PersonLine = ({ </TableCell> {showStatusColumn && - (person.active ? ( + (!isBefore(role.end_date, today) ? ( <TableCell sx={{ color: 'green' }} align="left"> {t('common:active')} </TableCell>