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(); +}