Changeset a7bcf66 in Klonkt for src/assets/js/guardian.js
- Timestamp:
- 07/28/2026 06:30:43 PM (6 weeks ago)
- Branches:
- main
- Children:
- 70677e96
- Parents:
- d9ad6c5
- File:
-
- 1 edited
-
src/assets/js/guardian.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/guardian.js
rd9ad6c5 ra7bcf66 32 32 catch (e) { return uri; } 33 33 } 34 function when(s) { return String(s || '').slice(0, 16).replace('T', ' '); } 34 // The server hands over a timestamp already formatted in the site's timezone 35 // (Beheer -> Instellingen), the same clock de Krant and Berichten show. The 36 // slice is only a fallback for a row that predates that field: it shows raw 37 // UTC, which is what made a 20:20 call for help read 18:20. 38 function when(item, raw) { 39 if (item && item.when_text) return item.when_text; 40 return String(raw || '').slice(0, 16).replace('T', ' '); 41 } 35 42 function show(id, on) { document.getElementById(id).hidden = !on; } 36 43 … … 49 56 else who.textContent = h.actor_name || handleOf(h.actor_uri, h.actor_handle); 50 57 row.appendChild(who); 51 row.appendChild(el('span', 'when', when(h .published || h.created_at)));58 row.appendChild(el('span', 'when', when(h, h.published || h.created_at))); 52 59 card.appendChild(row); 53 60 var body = el('div', 'body g-note'); … … 197 204 var head = el('div', 'row'); 198 205 head.appendChild(el('span', 'who grow', p.author)); 199 if (p.published) head.appendChild(el('span', 'g-when', when(p .published)));206 if (p.published) head.appendChild(el('span', 'g-when', when(p, p.published))); 200 207 card.appendChild(head); 201 208 var body = el('div', 'feed-body');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)