better date formatting

This commit is contained in:
Joonas 2023-01-14 14:19:09 +02:00
parent 5674cc3d59
commit 0043a6dbb8
1 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ export default function Thread() {
<Overlay>
<div className="flex flex-col p-12 bg-ctp-crust outline rounded">
<div className="bg-ctp-base rounded p-4">
<span><strong>{data.title}</strong> Post id: <strong>{data.id}</strong> Created at: <strong>{data.createdAt}</strong> Reply count: <strong>{data.posts.length}</strong></span>
<span><strong>{data.title}</strong> Post id: <strong>{data.id}</strong> Created at: <strong>{new Date(data.createdAt).toLocaleString()}</strong> Reply count: <strong>{data.posts.length}</strong></span>
<br />
<a href={`/uploads/${data.imageName}`} target="_blank" referrerPolicy="no-referrer"><img src={`/uploads/${data.imageName}`} alt="post image" width={240} /></a>
<p>{data.post}</p>
@ -85,7 +85,7 @@ export default function Thread() {
{data.posts.map(post =>
<li id={`${post.id}`} className="rounded shadow p-4 m-4 odd:bg-ctp-mantle even:bg-ctp-base" key={post.id}>
<div className="flex">
<span>Reply id: <strong>{post.id}</strong> Replied at: <strong>{post.createdAt} </strong></span>
<span>Reply id: <strong>{post.id}</strong> Replied at: <strong>{new Date(post.createdAt).toLocaleString()} </strong></span>
<Link className="mx-2 text-ctp-rosewater hover:text-ctp-maroon hover:underline" onClick={(event) => {
event.preventDefault();
document.getElementById(`bottom`).scrollIntoView(true);
@ -99,7 +99,7 @@ export default function Thread() {
<Link onClick={event => {
event.preventDefault();
document.getElementById(`${reply.id}`).scrollIntoView(true);
}} className="text-ctp-teal hover:text-ctp-sky hover:underline" to={`#${reply.id}`}>{reply.id}</Link>
}} className="text-ctp-teal hover:text-ctp-sky hover:underline" to={`#${reply.id}`}>#{reply.id}</Link>
</li>
)}
</ul>