Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/intl/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ export default {
statuses: 'Toots',
follows: 'Follows',
followers: 'Followers',
joined: 'Joined',
moreOptions: 'More options',
followersLabel: 'Followed by {count}',
followingLabel: 'Follows {count}',
joinedLabel: 'Joined on {date}',
followLabel: `Follow {requested, select,
true {(follow requested)}
other {}
Expand Down
18 changes: 17 additions & 1 deletion src/routes/_components/profile/AccountProfileDetails.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
<div class="account-profile-details">
<span class="account-profile-details-item"
aria-label={joinedLabel}
>
<span class="account-profile-details-item-datum">
{joinDate}
</span>
<span class="account-profile-details-item-title">
{intl.joined}
</span>
</span>
<div class="account-profile-details-item">
<span class="account-profile-details-item-datum">
{numStatusesDisplay}
Expand Down Expand Up @@ -93,6 +103,7 @@ <h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
import { LOCALE } from '../../_static/intl.js'
import { formatIntl } from '../../_utils/formatIntl.js'
import { thunk } from '../../_utils/thunk.js'
import { shortAbsoluteDateOnlyFormatter } from '../../_utils/formatters.js'

const numberFormat = thunk(() => new Intl.NumberFormat(LOCALE))

Expand All @@ -114,7 +125,12 @@ <h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
),
followingLabel: ({ numFollowing }) => (
formatIntl('intl.followingLabel', { count: numFollowing })
)
),
joinedLabel: ({ joinDate }) => (
formatIntl('intl.joinedLabel', { date: joinDate })
),
createdAtDateTS: ({ account }) => new Date(account.created_at).getTime(),
joinDate: ({ createdAtDateTS }) => shortAbsoluteDateOnlyFormatter().format(createdAtDateTS)
}
}
</script>
6 changes: 6 additions & 0 deletions src/routes/_utils/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ export const dayOnlyAbsoluteDateFormatter = thunk(() => safeFormatter(new Intl.D
month: 'short',
day: 'numeric'
})))

export const shortAbsoluteDateOnlyFormatter = thunk(() => safeFormatter(new Intl.DateTimeFormat(LOCALE, {
year: 'numeric',
month: 'short',
day: 'numeric',
})))