add approximate times to post list

This commit is contained in:
mehbark 2026-01-26 14:02:44 -05:00
parent ff92058038
commit 6db201b31a
Signed by: mbk
GPG key ID: E333EC1335FFCCDB

View file

@ -5,6 +5,8 @@ tags: special
export function PostLink({post}) {
const tags = post.data.tags.filter(t => t != "post");
const two_digits = n => n.toString().padStart(2, "0");
const time = `${two_digits(post.date.getHours())}:${two_digits(post.date.getMinutes())}`;
return <>
<a href={post.url}>
{post.data.title}
@ -12,7 +14,9 @@ export function PostLink({post}) {
{" "}
({tags.join(", ")})
{" "}
(<time dateTime={post.date.toISOString()}>{post.date.toDateString()}</time>)
(<time dateTime={post.date.toISOString()} title={`started at about ${time}`}>
{post.date.toDateString()}
</time>)
</>
}