From 60a8a89f5b7526af44c9682e151dd92c979b1412 Mon Sep 17 00:00:00 2001
From: rinpatch <rinpatch@sdf.org>
Date: Thu, 3 Dec 2020 00:17:55 +0300
Subject: Use app locale with toLocaleString/toLocaleDateString

Fixes inconsistent date formatting when browser language is different
from PleromaFE language.
---
 src/components/chat_message_date/chat_message_date.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/components/chat_message_date/chat_message_date.vue')

diff --git a/src/components/chat_message_date/chat_message_date.vue b/src/components/chat_message_date/chat_message_date.vue
index 79c346b6..98349b75 100644
--- a/src/components/chat_message_date/chat_message_date.vue
+++ b/src/components/chat_message_date/chat_message_date.vue
@@ -5,6 +5,8 @@
 </template>
 
 <script>
+import localeService from 'src/services/locale/locale.service.js'
+
 export default {
   name: 'Timeago',
   props: ['date'],
@@ -16,7 +18,7 @@ export default {
       if (this.date.getTime() === today.getTime()) {
         return this.$t('display_date.today')
       } else {
-        return this.date.toLocaleDateString('en', { day: 'numeric', month: 'long' })
+        return this.date.toLocaleDateString(localeService.internalToBrowserLocale(this.$i18n.locale), { day: 'numeric', month: 'long' })
       }
     }
   }
-- 
cgit v1.2.3-70-g09d2

