Skip to content
Snippets Groups Projects
Verified Commit 7bfb2464 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Adjust status logic in frontend

The status column now signifies if the role on that line is active or
not.
parent 2c436668
No related branches found
No related tags found
1 merge request!130Greg 93 fixtures
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment