fix hook order error
This commit is contained in:
@ -42,14 +42,14 @@ export default function Conversation() {
|
||||
{(!isPreviousMessageFromSameSender || !shouldGroupMessages) && (
|
||||
<div className="flex py-2 space-x-1 text-xs justify-center">
|
||||
<strong>
|
||||
{new Date(message.sentAt).toLocaleDateString("fr-FR", {
|
||||
{new Date(message.sentAt).toLocaleDateString("en-US", {
|
||||
weekday: "long",
|
||||
day: "2-digit",
|
||||
month: "short",
|
||||
})}
|
||||
</strong>
|
||||
<span>
|
||||
{new Date(message.sentAt).toLocaleTimeString("fr-FR", {
|
||||
{new Date(message.sentAt).toLocaleTimeString("en-US", {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
})}
|
||||
|
@ -43,7 +43,7 @@ function formatMessageDate(date: Date): string {
|
||||
|
||||
const isToday = diff.days > -1;
|
||||
if (isToday) {
|
||||
return messageDate.toFormat("HH:mm", { locale: "fr-FR" });
|
||||
return messageDate.toFormat("HH:mm", { locale: "en-US" });
|
||||
}
|
||||
|
||||
const isDuringLastWeek = diff.days > -8;
|
||||
@ -51,5 +51,5 @@ function formatMessageDate(date: Date): string {
|
||||
return messageDate.weekdayLong;
|
||||
}
|
||||
|
||||
return messageDate.toFormat("dd/MM/yyyy", { locale: "fr-FR" });
|
||||
return messageDate.toFormat("dd/MM/yyyy", { locale: "en-US" });
|
||||
}
|
||||
|
Reference in New Issue
Block a user