Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenhelium committed Dec 1, 2023
1 parent 0b8d11e commit 7c09410
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,3 +668,19 @@ export function addNumMonthsToDate(

return dateSafe;
}

export function isValidDate<T extends string | number | Date>(
value: T | null | undefined,
): value is T {
if (isNotDefined(value)) {
return false;
}

const date = new Date(value);

if (Number.isNaN(date.getTime())) {
return false;
}

return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { numericIdSelector } from '#utils/selectors';
import useFilterState from '#hooks/useFilterState';

import i18n from './i18n.json';
import styles from './styles.module.css';

type PersonnelTableItem = NonNullable<GoApiResponse<'/api/v2/personnel/'>['results']>[number];
const now = new Date().toISOString();
Expand Down Expand Up @@ -76,7 +77,10 @@ export default function RapidResponsePersonnelTable(props: Props) {
'role',
strings.personnelTablePosition,
(item) => item.role,
{ sortable: true },
{
sortable: true,
columnClassName: styles.role,
},
),
createStringColumn<PersonnelTableItem, number>(
'type',
Expand Down Expand Up @@ -137,6 +141,7 @@ export default function RapidResponsePersonnelTable(props: Props) {

return (
<Container
className={styles.rapidResponsePersonnelTable}
heading={strings.rapidResponseTitle}
withHeaderBorder
actions={(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.rapid-response-personnel-table {
.role {
width: 15rem;
}
}

0 comments on commit 7c09410

Please sign in to comment.