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>
|
||||
|
|
|
@ -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 ? (
|
||||
|
|
|
@ -354,7 +354,7 @@ export default function UserFiles({ router, globalData }) {
|
|||
>
|
||||
<div>{name}</div>
|
||||
<div title={new Date(date).toLocaleString()}>
|
||||
{new Date(date).toDateString()}
|
||||
{new Date(date).toLocaleDateString()}
|
||||
</div>
|
||||
<div>
|
||||
{currDir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue