import React from "react"; import { Message, MessageType } from "./types"; export const MessageContainer = ( { type, fromUserId, toUserId, content, timeMillis, }: Message ): React.ReactElement => { const dateTime: Date = new Date(timeMillis); /* FIXED funny error * DESCRIPTION * The line below was * return (

[{dateTime.toLocaleString(Intl.DateTimeFormat().resolvedOptions().timeZone)}]...

) * The line incorrectly generated a value of "UTC" as the parameter to toLocaleString() * While "UTC" is an accepted string value, in EEST, aka. "Europe/Athens" timezone string is not an acceptable parameter. * This caused the return statement to fail, and the message fails to render, despite it being correctly committed to the db. * Funny clown moment 🤡 */ return (

[{dateTime.toLocaleString()}] Message from {fromUserId}: {content}

); };