diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-04-10 19:05:10 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-04-10 19:05:10 +0200 |
commit | b73ed6ebd3cca86de065549cfb0d109a1d0461c5 (patch) | |
tree | 72e601618b215599cc6646bd2c6df058b053406f /src/jwebmail/static/src/localtime.js | |
parent | f06e7e51f84e9260410108ed527f3c8cbe28fbdd (diff) |
split js files and do local time conversion
Diffstat (limited to 'src/jwebmail/static/src/localtime.js')
-rw-r--r-- | src/jwebmail/static/src/localtime.js | 5 |
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()); +}); |