mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Date display fixes
This commit is contained in:
parent
5369f942f6
commit
18f0608c30
3 changed files with 15 additions and 4 deletions
|
@ -16,6 +16,7 @@ export default function NewsEntry({
|
|||
onPostDelete,
|
||||
}) {
|
||||
const { reacts, title, content, user, comments, date, admin } = newsItem
|
||||
const dateObj = new Date(date)
|
||||
|
||||
return (
|
||||
<div className={styles.newsRoot}>
|
||||
|
@ -34,7 +35,12 @@ export default function NewsEntry({
|
|||
User #{user}
|
||||
</a>
|
||||
</Link>
|
||||
<div className={styles.newsDate}> @ {date}</div>
|
||||
<div className={styles.newsDate} title={dateObj.toLocaleString()}>
|
||||
@
|
||||
{dateObj.getDate() !== new Date().getDate()
|
||||
? dateObj.toLocaleDateString()
|
||||
: dateObj.toLocaleTimeString()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{admin ? (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue