mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Show relative dates on search list
This commit is contained in:
parent
25f5343b25
commit
38c2954d23
2 changed files with 38 additions and 3 deletions
24
components/relative-time.vue
Normal file
24
components/relative-time.vue
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue