1/* ========================================================= 2 DFÃGUASCLARAS â Helpers de formatação de data/hora 3 Os dados de notÃcias vêm da REST API do WordPress (js/wp-api.js). 4========================================================= */ 5 6function formatDate(iso) { 7 const d = new Date(iso); 8 return d.toLocaleDateString("pt-BR", { day: "2-digit", month: "2-digit", year: "numeric" }); 9} 10function formatDateLong(iso) { 11 const d = new Date(iso); 12 const dateStr = d.toLocaleDateString("pt-BR", { day: "2-digit", month: "long", year: "numeric" }); 13 const timeStr = d.toLocaleTimeString("pt-BR", { hour: "2-digit", minute: "2-digit" }); 14 return `${dateStr} à s ${timeStr}`; 15} 16function timeAgo(iso) { 17 const diff = (Date.now() - new Date(iso).getTime()) / 1000; 18 if (diff < 3600) return `${Math.max(1, Math.floor(diff / 60))} min atrás`; 19 if (diff < 86400) return `${Math.floor(diff / 3600)} h atrás`; 20 return `${Math.floor(diff / 86400)} dias atrás`; 21}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.