2018-02-10 07:55:11 +01:00
|
|
|
|
<a class="status-relative-date {{isStatusInNotification ? 'status-in-notification' : '' }}"
|
2018-03-16 04:04:24 +01:00
|
|
|
|
href="/statuses/{{originalStatusId}}"
|
2018-04-30 02:45:03 +02:00
|
|
|
|
focus-key={{focusKey}}
|
2018-02-10 22:57:04 +01:00
|
|
|
|
>
|
2018-04-30 02:45:03 +02:00
|
|
|
|
<time datetime={{createdAtDate}} title={{relativeDate}}
|
2018-03-16 04:04:24 +01:00
|
|
|
|
aria-label="{{relativeDate}} – click to show thread">
|
|
|
|
|
{{relativeDate}}
|
|
|
|
|
</time>
|
2018-02-10 07:55:11 +01:00
|
|
|
|
</a>
|
|
|
|
|
<style>
|
|
|
|
|
.status-relative-date {
|
|
|
|
|
grid-area: relative-date;
|
|
|
|
|
align-self: center;
|
|
|
|
|
margin-left: 5px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
font-size: 1.1em;
|
|
|
|
|
text-align: right;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
.status-relative-date, .status-relative-date:hover, .status-relative-date:visited {
|
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-relative-date.status-in-notification,
|
|
|
|
|
.status-relative-date.status-in-notification:hover,
|
|
|
|
|
.status-relative-date.status-in-notification:visited {
|
|
|
|
|
color: var(--very-deemphasized-text-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
<script>
|
|
|
|
|
import { mark, stop } from '../../_utils/marks'
|
2018-02-13 19:12:52 +01:00
|
|
|
|
import timeago from 'timeago.js'
|
|
|
|
|
const timeagoInstance = timeago()
|
2018-02-10 07:55:11 +01:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
computed: {
|
2018-03-16 04:04:24 +01:00
|
|
|
|
createdAtDate: (originalStatus) => originalStatus.created_at,
|
2018-02-10 07:55:11 +01:00
|
|
|
|
relativeDate: (createdAtDate) => {
|
|
|
|
|
mark('compute relativeDate')
|
2018-02-13 19:12:52 +01:00
|
|
|
|
let res = timeagoInstance.format(createdAtDate)
|
2018-02-10 07:55:11 +01:00
|
|
|
|
stop('compute relativeDate')
|
|
|
|
|
return res
|
2018-02-10 22:57:04 +01:00
|
|
|
|
},
|
2018-03-16 04:04:24 +01:00
|
|
|
|
focusKey: (uuid) => `status-relative-date-${uuid}`
|
2018-02-10 07:55:11 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|