summaryrefslogtreecommitdiff
path: root/static/js/components/formatDate.js
diff options
context:
space:
mode:
authorLizzy Hunt <lizzy.hunt@usu.edu>2024-03-29 16:35:04 -0600
committerLizzy Hunt <lizzy.hunt@usu.edu>2024-03-29 16:35:04 -0600
commit5080c566ac31ec622986c04f1812a1e88c88210e (patch)
treed8dbaa766ef21b098c5740880facc2989c750295 /static/js/components/formatDate.js
parent7cc13887eae7dd2a61900751e038d273313d077f (diff)
downloadhatecomputers.club-5080c566ac31ec622986c04f1812a1e88c88210e.tar.gz
hatecomputers.club-5080c566ac31ec622986c04f1812a1e88c88210e.zip
guestbook!
Diffstat (limited to 'static/js/components/formatDate.js')
-rw-r--r--static/js/components/formatDate.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/static/js/components/formatDate.js b/static/js/components/formatDate.js
new file mode 100644
index 0000000..a12f04f
--- /dev/null
+++ b/static/js/components/formatDate.js
@@ -0,0 +1,7 @@
+const timeElements = document.querySelectorAll(".time");
+timeElements.forEach((timeElement) => {
+ const dateStr = timeElement.textContent.split(" ").slice(0, 3).join(" ");
+ const date = new Date(dateStr);
+
+ timeElement.textContent = date.toLocaleString();
+});