add approximate times to post list
This commit is contained in:
parent
ff92058038
commit
6db201b31a
1 changed files with 5 additions and 1 deletions
|
|
@ -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>)
|
||||
</>
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue