funkwhale/front/src/components/common/HumanDate.vue
2018-03-01 23:46:32 +01:00

20 lines
425 B
Vue

<template>
<time :datetime="date" :title="date | moment">{{ realDate | ago }}</time>
</template>
<script>
import {mapState} from 'vuex'
export default {
props: ['date'],
computed: {
...mapState({
lastDate: state => state.ui.lastDate
}),
realDate () {
if (this.lastDate) {
// dummy code to trigger a recompute to update the ago render
}
return this.date
}
}
}
</script>