From 67d9317f20e139d50d9b7f6d1048b88185733b14 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 8 Jul 2020 14:43:43 +0300 Subject: [PATCH] Fix date marker not displaying sometimes --- client/components/MessageList.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/components/MessageList.vue b/client/components/MessageList.vue index 092ecef2..e4945084 100644 --- a/client/components/MessageList.vue +++ b/client/components/MessageList.vue @@ -204,7 +204,14 @@ export default { return true; } - return new Date(previousMessage.time).getDay() !== new Date(message.time).getDay(); + const oldDate = new Date(previousMessage.time); + const newDate = new Date(message.time); + + return ( + oldDate.getDate() !== newDate.getDate() || + oldDate.getMonth() !== newDate.getMonth() || + oldDate.getFullYear() !== newDate.getFullYear() + ); }, shouldDisplayUnreadMarker(id) { if (!unreadMarkerShown && id > this.channel.firstUnread) {