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}`}
|
`https://api.dicebear.com/6.x/initials/svg?seed=${community_view.community.name}`}
|
||||||
alt={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 />
|
<Icon src={Calendar} width={16} height={16} mini />
|
||||||
<RelativeDate date={new Date(community_view.community.published)} />
|
<RelativeDate date={new Date(community_view.community.published)} />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -87,12 +87,10 @@
|
|||||||
>
|
>
|
||||||
<details bind:open class="flex flex-col gap-1">
|
<details bind:open class="flex flex-col gap-1">
|
||||||
<summary
|
<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 avatarSize={20} avatar user={node.comment_view.creator} />
|
||||||
<UserLink avatar user={node.comment_view.creator} />
|
<span class="opacity-60">
|
||||||
</span>
|
|
||||||
<span class="text-sm opacity-60">
|
|
||||||
<RelativeDate date={new Date(node.comment_view.comment.published)} />
|
<RelativeDate date={new Date(node.comment_view.comment.published)} />
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
export let user: Person
|
export let user: Person
|
||||||
export let avatar: boolean = false
|
export let avatar: boolean = false
|
||||||
|
export let avatarSize = 24
|
||||||
|
|
||||||
function linkFromCommunity(user: Person) {
|
function linkFromCommunity(user: Person) {
|
||||||
const domain = new URL(user.actor_id).hostname
|
const domain = new URL(user.actor_id).hostname
|
||||||
@@ -19,8 +20,8 @@
|
|||||||
src={user.avatar ??
|
src={user.avatar ??
|
||||||
`https://api.dicebear.com/6.x/initials/svg?seed=${user.name}`}
|
`https://api.dicebear.com/6.x/initials/svg?seed=${user.name}`}
|
||||||
alt=""
|
alt=""
|
||||||
width={24}
|
width={avatarSize}
|
||||||
height={24}
|
height={avatarSize}
|
||||||
class="rounded-full aspect-square object-cover"
|
class="rounded-full aspect-square object-cover"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
|
|
||||||
// Create a RelativeTimeFormat instance with user's locale and options
|
// Create a RelativeTimeFormat instance with user's locale and options
|
||||||
const rtf = new Intl.RelativeTimeFormat(navigator.language, {
|
const rtf = new Intl.RelativeTimeFormat(navigator.language, {
|
||||||
numeric: 'auto',
|
numeric: 'always',
|
||||||
|
style: 'long',
|
||||||
})
|
})
|
||||||
|
|
||||||
return rtf.format(-value, thresholds[i].unit as any)
|
return rtf.format(-value, thresholds[i].unit as any)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -107,9 +108,9 @@
|
|||||||
width={24}
|
width={24}
|
||||||
alt={postData.community.name}
|
alt={postData.community.name}
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col text-xs">
|
||||||
<CommunityLink community={postData.community} />
|
<CommunityLink community={postData.community} />
|
||||||
<span class="opacity-50 flex flex-row gap-1 text-sm">
|
<span class="opacity-50 flex flex-row gap-1">
|
||||||
<UserLink user={postData.creator} />
|
<UserLink user={postData.creator} />
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<RelativeDate date={new Date(postData.post.published)} />
|
<RelativeDate date={new Date(postData.post.published)} />
|
||||||
|
|||||||
Reference in new issue
Block a user