summaryrefslogtreecommitdiff
path: root/static/js/components/formatDate.js
diff options
context:
space:
mode:
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();
+});