summaryrefslogtreecommitdiff
path: root/web/source
diff options
context:
space:
mode:
Diffstat (limited to 'web/source')
-rw-r--r--web/source/frontend/index.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/source/frontend/index.js b/web/source/frontend/index.js
index b88c64680..9ea10a477 100644
--- a/web/source/frontend/index.js
+++ b/web/source/frontend/index.js
@@ -181,3 +181,23 @@ Array.from(document.getElementsByClassName("plyr-video")).forEach((video) => {
video._player = player;
video._plyrContainer = player.elements.container;
});
+
+document.addEventListener('DOMContentLoaded', () => {
+ const timeTags = document.getElementsByTagName('time');
+ Array.from(timeTags).forEach(timeTag => {
+ const datetime = timeTag.getAttribute('datetime');
+ const currentText = timeTag.textContent.trim();
+ // Only format if current text contains precise time
+ if (currentText.match(/\d{2}:\d{2}/)) {
+ const date = new Date(datetime);
+ timeTag.textContent = date.toLocaleString(undefined, {
+ year: 'numeric',
+ month: 'short',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ hour12: false
+ });
+ }
+ });
+});