File tree 5 files changed +21
-12
lines changed
5 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ export interface Data {
13
13
closedAt : string | undefined ;
14
14
}
15
15
16
+ function generateDate ( date : string ) {
17
+ const time = new Date ( date ) . toLocaleTimeString ( "en" , {
18
+ timeStyle : "medium" ,
19
+ hour12 : false ,
20
+ } ) ;
21
+ return `${ date . substring ( 0 , 10 ) } ${ time } ` ;
22
+ }
23
+
16
24
export function Issue ( issue : IssueData ) {
17
25
return (
18
26
< tr >
@@ -31,7 +39,7 @@ export function Issue(issue: IssueData) {
31
39
</ div >
32
40
< div className = "text-xs leading-5 text-gray-400 font-bold" >
33
41
{ issue . issueState === "OPEN"
34
- ? `Created at: ${ issue . issueData . createdAt } `
42
+ ? `Created at: ${ generateDate ( issue . issueData . createdAt ) } `
35
43
: `Closed at: ${ issue . issueData . closedAt } ` }
36
44
</ div >
37
45
</ td >
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ export interface CommentData {
4
4
}
5
5
6
6
export function IssueComment ( comment : CommentData ) {
7
- const issueDate = comment . publishedAt ;
8
-
9
- const time = new Date ( issueDate ) . toLocaleTimeString ( "en" , {
10
- timeStyle : "medium" ,
11
- hour12 : false ,
12
- } ) ;
13
-
14
- const date = issueDate . substring ( 0 , 10 ) ;
7
+
8
+ function generateDate ( date : string ) {
9
+ const time = new Date ( date ) . toLocaleTimeString ( "en" , {
10
+ timeStyle : "medium" ,
11
+ hour12 : false ,
12
+ } ) ;
13
+ return ` ${ date . substring ( 0 , 10 ) } ${ time } ` ;
14
+ }
15
15
16
16
return (
17
17
< >
@@ -31,7 +31,7 @@ export function IssueComment(comment: CommentData) {
31
31
</ p >
32
32
</ div >
33
33
< p className = "text-gray-400 text-sm" >
34
- { date } { time }
34
+ { generateDate ( comment . publishedAt ) }
35
35
</ p >
36
36
</ div >
37
37
</ div >
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ function IssuesTable(issuesTableData: IssuesTableData) {
78
78
containerClassName = "pagination"
79
79
activeClassName = "active"
80
80
className = "flex justify-around w-1/2 rounded-sm border-2 border-indigo-500/75"
81
+
81
82
/>
82
83
</ div >
83
84
</ div >
Original file line number Diff line number Diff line change 1
1
.navBarWrapper {
2
- @apply bg-gray-800 flex gap-4 text-white justify-start pb-4 mb-10;
2
+ @apply bg-gray-800 flex gap-4 text-white justify-start pb-1.5 mb-10;
3
3
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { BrowserRouter } from 'react-router-dom';
16
16
const client = new ApolloClient ( {
17
17
uri : 'https://api.github.com/graphql' ,
18
18
cache : new InMemoryCache ( ) ,
19
- headers :{ "Authorization" : "Bearer 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 " }
19
+ headers :{ "Authorization" : "Bearer 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 " }
20
20
} ) ;
21
21
22
22
ReactDOM . render (
You can’t perform that action at this time.
0 commit comments