Human date component

This commit is contained in:
Eliot Berriot 2018-02-22 23:34:52 +01:00
parent d0a9873a07
commit 7808d14a49
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
4 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,8 @@
<template>
<time :datetime="date" :title="date | moment">{{ date | ago }}</time>
</template>
<script>
export default {
props: ['date']
}
</script>

View File

@ -3,7 +3,7 @@
<div class="content">
<a class="author">{{ user.username }}</a>
<div class="metadata">
<div class="date">{{ date | ago }}</div>
<div class="date"><human-date :date="date"></human-date></div>
</div>
<div class="text" v-html="comment"></div>
</div>

View File

@ -0,0 +1,7 @@
import Vue from 'vue'
import HumanDate from '@/components/common/HumanDate'
Vue.component('human-date', HumanDate)
export default {}

View File

@ -14,6 +14,7 @@ import store from './store'
import config from './config'
import { sync } from 'vuex-router-sync'
import filters from '@/filters' // eslint-disable-line
import globals from '@/components/globals' // eslint-disable-line
sync(store, router)