mirror of
https://github.com/nolanlawson/pinafore
synced 2024-12-14 03:05:41 +01:00
37 lines
954 B
HTML
37 lines
954 B
HTML
<ExternalLink class="status-absolute-date" href="{{status.url}}" showIcon="true">
|
|
<time datetime={{createdAtDate}} title="{{formattedDate}}">{{formattedDate}}</time>
|
|
</ExternalLink>
|
|
<style>
|
|
:global(.status-absolute-date) {
|
|
grid-area: date;
|
|
font-size: 1.1em;
|
|
white-space: nowrap;
|
|
margin: 10px 5px;
|
|
justify-self: right;
|
|
}
|
|
|
|
:global(.status-absolute-date, .status-absolute-date:hover, .status-absolute-date:visited) {
|
|
color: var(--deemphasized-text-color);
|
|
}
|
|
</style>
|
|
<script>
|
|
import ExternalLink from '../ExternalLink.html'
|
|
|
|
const formatter = new Intl.DateTimeFormat('en-US', {
|
|
year: 'numeric',
|
|
month: 'long',
|
|
day: 'numeric',
|
|
hour: '2-digit',
|
|
minute: '2-digit'
|
|
})
|
|
|
|
export default {
|
|
computed: {
|
|
createdAtDate: (status) => status.created_at,
|
|
formattedDate: (createdAtDate) => formatter.format(new Date(createdAtDate))
|
|
},
|
|
components: {
|
|
ExternalLink
|
|
}
|
|
}
|
|
</script> |