web-next: home muestra las noticias con fecha larga en español
La home ya lee las noticias de home_noticia; se sembraron las 50 noticias reales del sitio en la BD. Ajustes de render: fecha en formato español largo («21 de junio de 2026») y contenido en <p> (con <br> y enlaces), como el markup original. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,12 +19,10 @@ function formatFecha(iso: string | Date | null): string {
|
|||||||
if (!iso) return ''
|
if (!iso) return ''
|
||||||
const d = new Date(iso)
|
const d = new Date(iso)
|
||||||
if (isNaN(d.getTime())) return String(iso)
|
if (isNaN(d.getTime())) return String(iso)
|
||||||
return d.toLocaleString('es-ES', {
|
return d.toLocaleDateString('es-ES', {
|
||||||
day: '2-digit',
|
day: 'numeric',
|
||||||
month: '2-digit',
|
month: 'long',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit',
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +125,7 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s
|
|||||||
<div key={n.id} className="noticia-item">
|
<div key={n.id} className="noticia-item">
|
||||||
<h3>{n.titulo}</h3>
|
<h3>{n.titulo}</h3>
|
||||||
<span className="date">{formatFecha(n.fecha)}</span>
|
<span className="date">{formatFecha(n.fecha)}</span>
|
||||||
<div
|
<p
|
||||||
className="noticia-contenido"
|
className="noticia-contenido"
|
||||||
dangerouslySetInnerHTML={{ __html: n.contenido }}
|
dangerouslySetInnerHTML={{ __html: n.contenido }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user