Add "Join Date" to profile, fixes #54
This commit is contained in:
parent
a7eaec3391
commit
c7d2dee162
|
@ -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 {}
|
||||
|
|
|
@ -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}
|
||||
|
@ -93,6 +103,7 @@
|
|||
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))
|
||||
|
||||
|
@ -114,7 +125,12 @@
|
|||
),
|
||||
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>
|
||||
|
|
|
@ -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',
|
||||
})))
|
||||
|
|
Loading…
Reference in New Issue