fix: timestamp format to [dd.mm.yyyy @ hh:mm]
This commit is contained in:
@@ -20,9 +20,12 @@ import remarkGfm from "remark-gfm";
|
|||||||
|
|
||||||
function formatTime(iso: string): string {
|
function formatTime(iso: string): string {
|
||||||
const date = new Date(iso);
|
const date = new Date(iso);
|
||||||
|
const day = date.getDate().toString().padStart(2, "0");
|
||||||
|
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
||||||
|
const year = date.getFullYear();
|
||||||
const hours = date.getHours().toString().padStart(2, "0");
|
const hours = date.getHours().toString().padStart(2, "0");
|
||||||
const minutes = date.getMinutes().toString().padStart(2, "0");
|
const minutes = date.getMinutes().toString().padStart(2, "0");
|
||||||
return `${hours}:${minutes}`;
|
return `[${day}.${month}.${year} @ ${hours}:${minutes}]`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderContent(content: string, memberUsernames: Set<string>) {
|
function renderContent(content: string, memberUsernames: Set<string>) {
|
||||||
@@ -365,7 +368,7 @@ export function ChatArea() {
|
|||||||
{selectedIds.has(message.id) ? '[x]' : '[ ]'}
|
{selectedIds.has(message.id) ? '[x]' : '[ ]'}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span className="text-gb-fg-f">[{formatTime(message.created_at)}]</span>{" "}
|
<span className="text-gb-fg-f">{formatTime(message.created_at)}</span>{' '}
|
||||||
<span className="text-gb-aqua hover:text-gb-orange cursor-pointer" onClick={() => setProfileUserId(message.author_id)}>
|
<span className="text-gb-aqua hover:text-gb-orange cursor-pointer" onClick={() => setProfileUserId(message.author_id)}>
|
||||||
<{message.author_username}>
|
<{message.author_username}>
|
||||||
</span>{" "}
|
</span>{" "}
|
||||||
|
|||||||
Reference in New Issue
Block a user