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:
@@ -9,11 +9,11 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s
|
|||||||
return { title: t('changelogs.title') }
|
return { title: t('changelogs.title') }
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatFecha(iso: string): string {
|
function formatFecha(iso: string, locale: string): string {
|
||||||
if (!iso) return ''
|
if (!iso) return ''
|
||||||
const d = new Date(iso)
|
const d = new Date(iso)
|
||||||
if (isNaN(d.getTime())) return iso
|
if (isNaN(d.getTime())) return iso
|
||||||
return d.toLocaleString('es-ES', {
|
return d.toLocaleString(locale === 'en' ? 'en-US' : 'es-ES', {
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
@@ -52,7 +52,7 @@ export default async function ChangelogsPage({
|
|||||||
{commits.map((c) => (
|
{commits.map((c) => (
|
||||||
<div key={c.sha} className="noticia-item">
|
<div key={c.sha} className="noticia-item">
|
||||||
<h3>{c.title}</h3>
|
<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">
|
<p className="third-brown small-font">
|
||||||
{c.author}
|
{c.author}
|
||||||
{' · '}
|
{' · '}
|
||||||
|
|||||||
Reference in New Issue
Block a user