mirror of
https://github.com/urbit/shrub.git
synced 2025-01-08 06:00:27 +03:00
pull elapsed display out into separate script
This commit is contained in:
parent
8ecf2eff9f
commit
4d4349baff
@ -95,25 +95,15 @@
|
|||||||
{(trip (of-wain:format (scag 3 (no-title:colls wat.info.con))))}
|
{(trip (of-wain:format (scag 3 (no-title:colls wat.info.con))))}
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
;li.notes
|
;li.notes.mb-8
|
||||||
;div.da(data-da "{(esoo mod.info.con)}");
|
;div.da.text-mono(data-urb-elapsed "{(esoo mod.info.con)}");
|
||||||
;div.h3.mt-0.text-mono
|
;div.h3.mt-0.text-mono.note-uuid
|
||||||
;a(href "/~~/collections/{(trip -.s.bem.gas)}/{(trip t)}"): {(trip t)}
|
;a(href "/~~/collections/{(trip -.s.bem.gas)}/{(trip t)}"): {(trip t)}
|
||||||
==
|
==
|
||||||
;div.snippet
|
;div.snippet
|
||||||
{(trip (of-wain:format (scag 3 (no-title:colls wat.info.con))))}
|
{(trip (of-wain:format (scag 3 (no-title:colls wat.info.con))))}
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
;script:'''
|
|
||||||
var das = document.querySelectorAll('[data-da]');
|
|
||||||
for (var i=0; i < das.length; i ++) {
|
|
||||||
var urbD = das[i].dataset.da; // UTC
|
|
||||||
console.log(urbD);
|
|
||||||
var t = new Date(new Date(urbD).toUTCString()); // local
|
|
||||||
var clientDate = new Date(); // local
|
|
||||||
document.querySelector("[data-da='" + urbD + "']").innerHTML = t - clientDate;
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
==
|
==
|
||||||
|
|
||||||
==
|
==
|
||||||
|
Loading…
Reference in New Issue
Block a user