logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

chat_message_date.vue (576B)


  1. <template>
  2. <time>
  3. {{ displayDate }}
  4. </time>
  5. </template>
  6. <script>
  7. import localeService from 'src/services/locale/locale.service.js'
  8. export default {
  9. name: 'Timeago',
  10. props: ['date'],
  11. computed: {
  12. displayDate () {
  13. const 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. return this.date.toLocaleDateString(localeService.internalToBrowserLocale(this.$i18n.locale), { day: 'numeric', month: 'long' })
  19. }
  20. }
  21. }
  22. }
  23. </script>