direct_conversation_date.vue (526B)
1 <template> 2 <time> 3 {{ displayDate }} 4 </time> 5 </template> 6 7 <script> 8 export default { 9 name: 'Timeago', 10 props: ['date'], 11 computed: { 12 displayDate () { 13 let today = new Date() 14 today.setHours(0, 0, 0, 0) 15 if (this.date.getTime() === today.getTime()) { 16 return this.$t('display_date.today') 17 } else { 18 const lang = this.$store.getters.mergedConfig.interfaceLanguage 19 return this.date.toLocaleDateString(lang, { day: 'numeric', month: 'long' }) 20 } 21 } 22 } 23 } 24 </script>