pinafore/routes/_components/status/StatusAbsoluteDate.html
2018-02-10 14:27:05 -08:00

37 lines
956 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: 0 5px 10px;
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>