From 385673bb374d9b91fd6755e5618291837eec3719 Mon Sep 17 00:00:00 2001 From: Xylight Date: Sun, 8 Sep 2024 15:00:26 -0700 Subject: [PATCH] misc: add creation stat to community header --- .../components/lemmy/community/CommunityHeader.svelte | 9 +++++++++ src/lib/i18n/en.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/components/lemmy/community/CommunityHeader.svelte b/src/lib/components/lemmy/community/CommunityHeader.svelte index fcd71196..ddaac9ee 100644 --- a/src/lib/components/lemmy/community/CommunityHeader.svelte +++ b/src/lib/components/lemmy/community/CommunityHeader.svelte @@ -24,6 +24,8 @@ import ShieldIcon from '../moderation/ShieldIcon.svelte' import ItemList from '../generic/ItemList.svelte' import { userLink } from '$lib/lemmy/generic' + import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte' + import { publishedToDate } from '$lib/components/util/date' export let community: Community export let subscribed: SubscribedType @@ -50,6 +52,13 @@ name: $t('cards.community.activeDay'), value: counts.users_active_day.toString(), }, + { + name: $t('stats.created'), + format: false, + value: formatRelativeDate(publishedToDate(community.published), { + style: 'short', + }).toString(), + }, ] : []} bio={community.description} diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index e15d09e5..e94224a5 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -861,6 +861,7 @@ } }, "stats": { - "joined": "Joined" + "joined": "Joined", + "created": "Created" } }