Skip to content

Commit 04a2558

Browse files
authored
Merge pull request #113 from kailash360/add-date-111
Added "Created At" field in user-story
2 parents 0e06ed2 + bdbd1a6 commit 04a2558

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/pages/Story.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,18 @@ const Story = (props) => {
134134
fill='#42779B'
135135
/>
136136
</svg>
137-
<h2>{story.Title}</h2>
137+
<span>
138+
<h2 style={{ marginBlockEnd: '0px' }}>{story.Title}</h2>
139+
<br />
140+
<h4 style={{ marginBlockStart: '0px' }}>
141+
Created At:{' '}
142+
{new Date(story.createdAt).toLocaleDateString(undefined, {
143+
year: 'numeric',
144+
month: 'long',
145+
day: 'numeric'
146+
})}
147+
</h4>
148+
</span>
138149
<div className='author-information'>
139150
<h4>
140151
By:{' '}

src/services/user_story.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const userStory = {
8686
username
8787
}
8888
Category
89+
createdAt
8990
}
9091
}
9192
`
@@ -111,6 +112,7 @@ const userStory = {
111112
id
112113
url
113114
}
115+
createdAt
114116
}
115117
}
116118
${BASIC_STORY_INFO_FRAGMENT}

0 commit comments

Comments
 (0)