diff --git a/src/components/comments.js b/src/components/comments.js
index 863011c..c43c503 100644
--- a/src/components/comments.js
+++ b/src/components/comments.js
@@ -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}
-
@ {date}
- {date}
+
+ @
+ {dateObj.getDate() !== new Date().getDate()
+ ? dateObj.toLocaleDateString()
+ : dateObj.toLocaleTimeString()}
+
{content}
diff --git a/src/components/newsEntry.js b/src/components/newsEntry.js
index 0ce935c..aad95c3 100644
--- a/src/components/newsEntry.js
+++ b/src/components/newsEntry.js
@@ -16,6 +16,7 @@ export default function NewsEntry({
onPostDelete,
}) {
const { reacts, title, content, user, comments, date, admin } = newsItem
+ const dateObj = new Date(date)
return (
@@ -34,7 +35,12 @@ export default function NewsEntry({
User #{user}
-
@ {date}
+
+ @
+ {dateObj.getDate() !== new Date().getDate()
+ ? dateObj.toLocaleDateString()
+ : dateObj.toLocaleTimeString()}
+
{admin ? (
diff --git a/src/pages/userfiles.js b/src/pages/userfiles.js
index 6d40a65..bc904a6 100644
--- a/src/pages/userfiles.js
+++ b/src/pages/userfiles.js
@@ -354,7 +354,7 @@ export default function UserFiles({ router, globalData }) {
>
{name}
- {new Date(date).toDateString()}
+ {new Date(date).toLocaleDateString()}
{currDir