From af5e838232bc2f318f6bb351d56c4185889d80df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Fri, 29 May 2026 05:54:51 +0300 Subject: [PATCH] localize timestamps --- app/templates/common/macros.html | 2 +- data/static/js/bits/ui.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/templates/common/macros.html b/app/templates/common/macros.html index 84af04d..ec69331 100644 --- a/app/templates/common/macros.html +++ b/app/templates/common/macros.html @@ -5,7 +5,7 @@ {%- endmacro %} {% macro timestamp(unix_ts) -%} - + {%- endmacro %} {% macro subheader(title, desc='') -%} diff --git a/data/static/js/bits/ui.js b/data/static/js/bits/ui.js index cc701de..a94f86a 100644 --- a/data/static/js/bits/ui.js +++ b/data/static/js/bits/ui.js @@ -1,6 +1,6 @@ export const b = { babycodePreviewEndpoint: '/api/babycode-preview/', - init: 'babycodeEditorCharCountInit', + init: 'babycodeEditorCharCountInit localizeTimestamps', } const getThreadId = () => { @@ -215,3 +215,11 @@ export async function copyCode(ev, sender, el) { console.log(error); } } + +export function localizeTimestamps(_, __, el) { + if (el === undefined) { + return; + } + const d = new Date(el.dateTime); + el.innerText = d.toLocaleString(); +}