aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_message_date
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-07-14 11:44:06 +0300
committerShpuld Shpuldson <shp@cock.li>2020-07-14 11:44:06 +0300
commitcac1418affbc0ae91bce2a4d4c14046e73484116 (patch)
treeb8a9ef91853d7f4d3f35e632e0b3e71b5dd79c7d /src/components/chat_message_date
parent78ec84477e978a654ecfd482157dbf04a69f32e2 (diff)
parent3e09a708f600b47dde831eeddb412828b38a0cf4 (diff)
fix merge conflicts
Diffstat (limited to 'src/components/chat_message_date')
-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>