diff options
| author | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-03-29 16:35:04 -0600 |
|---|---|---|
| committer | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-03-29 16:35:04 -0600 |
| commit | 5080c566ac31ec622986c04f1812a1e88c88210e (patch) | |
| tree | d8dbaa766ef21b098c5740880facc2989c750295 /static/js/components | |
| parent | 7cc13887eae7dd2a61900751e038d273313d077f (diff) | |
| download | hatecomputers.club-5080c566ac31ec622986c04f1812a1e88c88210e.tar.gz hatecomputers.club-5080c566ac31ec622986c04f1812a1e88c88210e.zip | |
guestbook!
Diffstat (limited to 'static/js/components')
| -rw-r--r-- | static/js/components/formatDate.js | 7 |
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(); +}); |
