Added MIT License

Added README as basis for EPQ explanation
Added PAPERWORK as basis for Project Proposal Form
This commit is contained in:
Zhongheng Liu 2024-01-03 18:19:45 +02:00
commit e7a64d07f4
No known key found for this signature in database
5 changed files with 111 additions and 48 deletions

View file

@ -9,7 +9,16 @@ export const MessageContainer = (
content,
timeMillis,
}: Message
): React.ReactElement<{ sender: string; text: string; }> => {
): React.ReactElement<Message> => {
const dateTime: Date = new Date(timeMillis);
return (<p>[{dateTime.toLocaleString(Intl.DateTimeFormat().resolvedOptions().timeZone)}] Message from {fromUserId}: {content}</p>);
/* FIXED funny error
* DESCRIPTION
* The line below was
* return (<p>[{dateTime.toLocaleString(Intl.DateTimeFormat().resolvedOptions().timeZone)}]...</p>)
* 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 (<p>[{dateTime.toLocaleString()}] Message from {fromUserId}: {content}</p>);
};