changelogs: fecha por idioma (es-ES / en-US)

formatFecha usaba es-ES fijo; ahora recibe el locale y formatea en en-US para
inglés. /en/changelogs muestra "July 14, 2026 at 07:55 PM"; /es/ en español.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 19:58:31 +00:00
parent 85c5c995ee
commit 794021f9a3
+3 -3
View File
@@ -9,11 +9,11 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s
return { title: t('changelogs.title') }
}
function formatFecha(iso: string): string {
function formatFecha(iso: string, locale: string): string {
if (!iso) return ''
const d = new Date(iso)
if (isNaN(d.getTime())) return iso
return d.toLocaleString('es-ES', {
return d.toLocaleString(locale === 'en' ? 'en-US' : 'es-ES', {
day: 'numeric',
month: 'long',
year: 'numeric',
@@ -52,7 +52,7 @@ export default async function ChangelogsPage({
{commits.map((c) => (
<div key={c.sha} className="noticia-item">
<h3>{c.title}</h3>
<span className="date">{formatFecha(c.date)}</span>
<span className="date">{formatFecha(c.date, locale)}</span>
<p className="third-brown small-font">
{c.author}
{' · '}