Show relative dates on search list

This commit is contained in:
Sam Carlton 2020-11-21 15:37:35 -06:00
parent 25f5343b25
commit 38c2954d23
2 changed files with 38 additions and 3 deletions

View file

@ -0,0 +1,24 @@
<template>
<span>{{ relativeTime }}</span>
</template>
<script>
import parseGithubDate from '~/helpers/parse-github-date'
export default {
props: {
timestamp: {
type: String,
required: true
}
},
computed: {
relativeTime () {
return parseGithubDate(this.timestamp).relative
}
}
}
</script>