Skip to content

Commit 2a1414d

Browse files
authored
Merge pull request #1656 from SeedCompany/add-createdAt-to-partners
2 parents b8f318d + ae78ca6 commit 2a1414d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/components/Grid/ColumnTypes/dateColumn.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
GridValueGetter as ValueGetter,
77
} from '@mui/x-data-grid';
88
import { Nil } from '@seedcompany/common';
9+
import { DateTime } from 'luxon';
910
import { DateFilter } from '~/api/schema.graphql';
1011
import { CalendarDate } from '~/common';
1112
import { GridHeaderAddFilterButton } from '../GridHeaderAddFilterButton';
@@ -41,9 +42,15 @@ dateColumn.valueGetter =
4142
if (!value) {
4243
return null;
4344
}
45+
4446
if (CalendarDate.isDate(value)) {
4547
return value.toJSDate();
4648
}
49+
50+
if (DateTime.isDateTime(value)) {
51+
return value.toJSDate();
52+
}
53+
4754
if (typeof value === 'string') {
4855
return CalendarDate.fromISO(value).toJSDate();
4956
}

src/components/PartnersDataGrid/PartnerColumns.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export const PartnerColumns: Array<GridColDef<Partner>> = [
4444
valueGetter: dateColumn.valueGetter((_, { startDate }) => startDate.value),
4545
width: 130,
4646
},
47+
{
48+
headerName: 'Created Date',
49+
field: 'createdAt',
50+
...dateColumn(),
51+
width: 130,
52+
},
4753
{
4854
field: 'globalInnovationsClient',
4955
headerName: 'GPC',

src/components/PartnersDataGrid/partnerDataGridRow.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ fragment partnerDataGridRow on Partner {
2020
startDate {
2121
value
2222
}
23+
createdAt
2324
...TogglePin
2425
}

0 commit comments

Comments
 (0)