Commit 81cf8759 by PLN (Algolia)

dates default to the French long form; portrait shows as a squircle, not a circle

Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
parent 3cfb3ca4
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { fr } from 'date-fns/locale'
export default function Date({ dateString, dateFormat }) { /**
* Localized date. The site's default language is French, so the default is
* the French long form ("1er novembre 2026"); `dateFormat` still wins when a
* caller wants a specific shape.
*/
export default function Date({ dateString, dateFormat, lang = 'fr' }) {
const date = parseISO(dateString) const date = parseISO(dateString)
const finalFormat = dateFormat || 'LLLL d, yyyy' const finalFormat = dateFormat || 'd LLLL yyyy'
return <time dateTime={dateString}>{format(date, finalFormat)}</time> return (
<time dateTime={dateString}>
{format(date, finalFormat, { locale: lang === 'fr' ? fr : undefined })}
</time>
)
} }
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
line-height: 1.5; line-height: 1.5;
} }
/* The portrait is square art — a hard circle crops it badly, a squircle
keeps the whole frame. */
.borderCircle { .borderCircle {
border-radius: 9999px; border-radius: 22%;
} }
.colorInherit { .colorInherit {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment