From 35c39a97f37c51f26791dcf9a1aad0cdfe9adffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 5 Jul 2026 20:39:50 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20adapter=20la=20date=20des=20commentaire?= =?UTF-8?q?s=20=C3=A0=20la=20locale=20du=20navigateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/teks/komante.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/teks/komante.jsx b/components/teks/komante.jsx index 4c45e8f..673749f 100644 --- a/components/teks/komante.jsx +++ b/components/teks/komante.jsx @@ -7,8 +7,6 @@ import Avatar from '@mui/material/Avatar' import Typography from '@mui/material/Typography' import Chip from '@mui/material/Chip' import Link from 'next/link' -import {format} from 'date-fns' -import {fr} from 'date-fns/locale' import {Mastodon} from '@icons-pack/react-simple-icons' function formatAuteur(commentaire) { @@ -24,7 +22,8 @@ function formatDat(commentaire) { return null } - return format(new Date(commentaire.datePublication), 'Pp', {locale: fr}) + return new Intl.DateTimeFormat(undefined, {dateStyle: 'short', timeStyle: 'short'}) + .format(new Date(commentaire.datePublication)) } const MENTION_REGEX = /(?:@[\w.-]+){1,2}/g