Merge pull request #461 from black-puppydog/timestamp-tooltip

Add absolute post time as tooltip to timestamps.
This commit is contained in:
Christian Bundy 2020-10-12 15:20:56 -07:00 committed by GitHub
commit 77f8b6c7bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -334,7 +334,10 @@ const post = ({ msg, aside = false }) => {
);
const { name } = msg.value.meta.author;
const timeAgo = msg.value.meta.timestamp.received.since.replace("~", "");
const ts_received = msg.value.meta.timestamp.received;
const timeAgo = ts_received.since.replace("~", "");
const timeAbsolute = ts_received.iso8601.split(".")[0].replace("T", " ");
const markdownContent = markdown(
msg.value.content.text,
@ -346,7 +349,6 @@ const post = ({ msg, aside = false }) => {
: { value: 1, class: null };
const likeCount = msg.value.meta.votes.length;
const maxLikedNameLength = 16;
const maxLikedNames = 16;
@ -414,7 +416,10 @@ const post = ({ msg, aside = false }) => {
),
span({ class: "author-action" }, postOptions[msg.value.meta.postType]),
span(
{ class: "time" },
{
class: "time",
title: timeAbsolute,
},
isPrivate ? "🔒" : null,
a({ href: url.link }, nbsp, timeAgo)
)