diff --git a/client/index.html b/client/index.html index 6f848dc..83ce736 100644 --- a/client/index.html +++ b/client/index.html @@ -4,6 +4,9 @@ + + + diff --git a/client/src/components/chat/chatArea/MessageElement.tsx b/client/src/components/chat/chatArea/MessageElement.tsx index bbaf8de..30be16a 100644 --- a/client/src/components/chat/chatArea/MessageElement.tsx +++ b/client/src/components/chat/chatArea/MessageElement.tsx @@ -5,7 +5,6 @@ import { ChatMessagesProps } from '@/types/types.ts'; import { useChat } from '@/context/chat/useChat.ts'; import { AuthContext } from '@/utils/AuthProvider.tsx'; import { format, isToday, isYesterday, formatDistanceToNow } from 'date-fns'; -import { pl } from 'date-fns/locale'; type AnimatedMessageProps = { message: ChatMessagesProps; @@ -26,20 +25,19 @@ const MessageElement = ({ onDelete, message }: AnimatedMessageProps) => { const formatMessageDate = (date: Date) => { if (isToday(date)) { - return `Dzisiaj o ${format(date, 'HH:mm')}`; + return `Today ${format(date, 'HH:mm')}`; } if (isYesterday(date)) { - return `Wczoraj o ${format(date, 'HH:mm')}`; + return `Yesterday ${format(date, 'HH:mm')}`; } - return format(date, "d MMMM yyyy 'o' HH:mm", { locale: pl }); + return format(date, 'dd.MM.yyyy HH:mm'); }; const messageDate = new Date(message.sent_at); const formattedDate = formatMessageDate(messageDate); - const fullDate = format(messageDate, "d MMMM yyyy 'o' HH:mm", { locale: pl }); + const fullDate = format(messageDate, 'dd.MM.yyyy HH:mm'); const timeAgo = formatDistanceToNow(messageDate, { addSuffix: true, - locale: pl, }); const canDelete = @@ -57,7 +55,7 @@ const MessageElement = ({ onDelete, message }: AnimatedMessageProps) => {