diff options
Diffstat (limited to 'template/static/js/components/formatDate.js')
-rw-r--r-- | template/static/js/components/formatDate.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/template/static/js/components/formatDate.js b/template/static/js/components/formatDate.js new file mode 100644 index 0000000..a12f04f --- /dev/null +++ b/template/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(); +}); |