doesitarm/components/relative-time.vue
2020-11-21 15:37:35 -06:00

24 lines
382 B
Vue

<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>