summaryrefslogtreecommitdiff
path: root/src/jwebmail/static/src/localtime.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jwebmail/static/src/localtime.js')
-rw-r--r--src/jwebmail/static/src/localtime.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jwebmail/static/src/localtime.js b/src/jwebmail/static/src/localtime.js
new file mode 100644
index 0000000..daa1455
--- /dev/null
+++ b/src/jwebmail/static/src/localtime.js
@@ -0,0 +1,5 @@
+document.querySelectorAll('time.jwm-tolocaltime').forEach($e => {
+ const dateTime = new Date($e.dateTime);
+ $e.innerHTML = new Intl.DateTimeFormat(document.documentElement.lang).
+ format(dateTime.toLocaleString());
+});