File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,19 @@ import {
9
9
Skeleton ,
10
10
Table ,
11
11
Title ,
12
+ Text ,
12
13
} from '@mantine/core' ;
13
14
import { IconAlertCircle , IconAlertTriangle } from '@tabler/icons-react' ;
14
15
import React , { useEffect , useState } from 'react' ;
15
16
import { GetInvoiceLinksResponse } from '@common/types/stripe' ;
16
17
import { notifications } from '@mantine/notifications' ;
17
18
import { useAuth } from '@ui/components/AuthContext' ;
18
19
import pluralize from 'pluralize' ;
20
+ import dayjs from 'dayjs' ;
21
+
22
+ const HumanFriendlyDate = ( { date } : { date : string | Date } ) => {
23
+ return < Text size = "sm" > { dayjs ( date ) . format ( 'MMMM D, YYYY' ) } </ Text > ;
24
+ } ;
19
25
20
26
interface StripeCurrentLinksPanelProps {
21
27
getLinks : ( ) => Promise < GetInvoiceLinksResponse > ;
@@ -82,7 +88,9 @@ export const StripeCurrentLinksPanel: React.FC<StripeCurrentLinksPanelProps> = (
82
88
< NumberFormatter prefix = "$" value = { data . invoiceAmountUsd / 100 } thousandSeparator />
83
89
</ Table . Td >
84
90
< Table . Td > { data . userId . replace ( userData ! . email ! , 'You' ) } </ Table . Td >
85
- < Table . Td > { data . createdAt === null ? 'Unknown' : data . createdAt } </ Table . Td >
91
+ < Table . Td >
92
+ { data . createdAt === null ? 'Unknown' : HumanFriendlyDate ( { date : data . createdAt } ) }
93
+ </ Table . Td >
86
94
< Table . Td >
87
95
< CopyButton value = { data . link } >
88
96
{ ( { copied, copy } ) => (
You can’t perform that action at this time.
0 commit comments