feat: hover on relative datetimes (#39)

Relative datetimes (e.g. "42m ago") are displayed for posts, comments,
user pages, community cards, and site cards. This patch wraps these
relative datetimes in a `<time>` tag which has a `title` attribute and
an ISO 8601 `datetime` attribute. The `title` allows users to see a
full, non-relative timestamp when hovering with the mouse.
This commit is contained in:
Thomas Faughnan authored and GitHub committed 2023-07-29 10:32:56 -07:00
1 parent baf5063279
commit a72ce72f7f
1 file changed
+3 -1
+3 -1
View File
@@ -35,4 +35,6 @@
}
</script>
{formatRelativeDate(date)}
<time datetime={date.toISOString()} title={date}>
{formatRelativeDate(date)}
</time>