misc: Update relative dates (again)
This commit is contained in:
1 parent
e259ceb6e4
commit
71ca33d9fc
5 files changed
+12
-11
No files matched your search
@@ -25,7 +25,7 @@
|
||||
`https://api.dicebear.com/6.x/initials/svg?seed=${community_view.community.name}`}
|
||||
alt={community_view.community.name}
|
||||
/>
|
||||
<span class="flex flex-row items-center gap-1 text-sm capitalize">
|
||||
<span class="flex flex-row items-center gap-1 text-sm">
|
||||
<Icon src={Calendar} width={16} height={16} mini />
|
||||
<RelativeDate date={new Date(community_view.community.published)} />
|
||||
</span>
|
||||
|
||||
@@ -87,12 +87,10 @@
|
||||
>
|
||||
<details bind:open class="flex flex-col gap-1">
|
||||
<summary
|
||||
class="flex flex-row cursor-pointer arrow gap-2 items-center group"
|
||||
class="flex flex-row cursor-pointer arrow gap-2 items-center group text-xs"
|
||||
>
|
||||
<span class="text-sm">
|
||||
<UserLink avatar user={node.comment_view.creator} />
|
||||
</span>
|
||||
<span class="text-sm opacity-60">
|
||||
<UserLink avatarSize={20} avatar user={node.comment_view.creator} />
|
||||
<span class="opacity-60">
|
||||
<RelativeDate date={new Date(node.comment_view.comment.published)} />
|
||||
</span>
|
||||
<span
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
export let user: Person
|
||||
export let avatar: boolean = false
|
||||
export let avatarSize = 24
|
||||
|
||||
function linkFromCommunity(user: Person) {
|
||||
const domain = new URL(user.actor_id).hostname
|
||||
@@ -19,8 +20,8 @@
|
||||
src={user.avatar ??
|
||||
`https://api.dicebear.com/6.x/initials/svg?seed=${user.name}`}
|
||||
alt=""
|
||||
width={24}
|
||||
height={24}
|
||||
width={avatarSize}
|
||||
height={avatarSize}
|
||||
class="rounded-full aspect-square object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
|
||||
// Create a RelativeTimeFormat instance with user's locale and options
|
||||
const rtf = new Intl.RelativeTimeFormat(navigator.language, {
|
||||
numeric: 'auto',
|
||||
numeric: 'always',
|
||||
style: 'long',
|
||||
})
|
||||
|
||||
return rtf.format(-value, thresholds[i].unit as any)
|
||||
|
||||
Reference in new issue
Block a user