localize timestamps
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro timestamp(unix_ts) -%}
|
{% macro timestamp(unix_ts) -%}
|
||||||
<time datetime="{{ unix_ts | iso8601 }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></time>
|
<time data-r="localizeTimestamps" datetime="{{ unix_ts | iso8601 }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></time>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro subheader(title, desc='') -%}
|
{% macro subheader(title, desc='') -%}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export const b = {
|
export const b = {
|
||||||
babycodePreviewEndpoint: '/api/babycode-preview/',
|
babycodePreviewEndpoint: '/api/babycode-preview/',
|
||||||
init: 'babycodeEditorCharCountInit',
|
init: 'babycodeEditorCharCountInit localizeTimestamps',
|
||||||
}
|
}
|
||||||
|
|
||||||
const getThreadId = () => {
|
const getThreadId = () => {
|
||||||
@@ -215,3 +215,11 @@ export async function copyCode(ev, sender, el) {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function localizeTimestamps(_, __, el) {
|
||||||
|
if (el === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const d = new Date(el.dateTime);
|
||||||
|
el.innerText = d.toLocaleString();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user