aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_message_date/chat_message_date.vue
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-09-07 09:47:17 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-09-07 09:47:17 +0300
commitfa2b680855c790ba8ed8d7cc0dbf2a3a2e1dbaf6 (patch)
treeb2868a1c0d2fce025134af4167c824fc8ee49068 /src/components/chat_message_date/chat_message_date.vue
parent12519a54b55140a3e5f76e67ac53914654c2a8b0 (diff)
parenta73b09c73202117ffa3fecf7a9185981d6696912 (diff)
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop
Diffstat (limited to 'src/components/chat_message_date/chat_message_date.vue')
-rw-r--r--src/components/chat_message_date/chat_message_date.vue24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/chat_message_date/chat_message_date.vue b/src/components/chat_message_date/chat_message_date.vue
new file mode 100644
index 00000000..79c346b6
--- /dev/null
+++ b/src/components/chat_message_date/chat_message_date.vue
@@ -0,0 +1,24 @@
+<template>
+ <time>
+ {{ displayDate }}
+ </time>
+</template>
+
+<script>
+export default {
+ name: 'Timeago',
+ props: ['date'],
+ computed: {
+ displayDate () {
+ const today = new Date()
+ today.setHours(0, 0, 0, 0)
+
+ if (this.date.getTime() === today.getTime()) {
+ return this.$t('display_date.today')
+ } else {
+ return this.date.toLocaleDateString('en', { day: 'numeric', month: 'long' })
+ }
+ }
+ }
+}
+</script>