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
|
@ -41,6 +41,7 @@ function Comment({ comment, index, onComment, onDelete, onReact, uid }) {
|
|||
const [displayed, setDisplayed] = useState(true)
|
||||
const [commenting, setCommenting] = useState(false)
|
||||
const { content, subComments, date, user, reacts, admin } = comment
|
||||
const dateObj = new Date(date)
|
||||
const own = uid === user
|
||||
|
||||
const commentStyle = admin
|
||||
|
@ -67,9 +68,13 @@ function Comment({ comment, index, onComment, onDelete, onReact, uid }) {
|
|||
User #{user}
|
||||
</a>
|
||||
</Link>
|
||||
<div className={styles.newsDate}> @ {date}</div>
|
||||
</div>
|
||||
<div className={styles.commentDate}>{date}</div>
|
||||
<div className={styles.commentDate} title={dateObj.toLocaleString()}>
|
||||
@
|
||||
{dateObj.getDate() !== new Date().getDate()
|
||||
? dateObj.toLocaleDateString()
|
||||
: dateObj.toLocaleTimeString()}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${!displayed && styles.hidden}`}>
|
||||
<div className={styles.commentText}> {content}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue