From 28169642b4ba9f590d994b8a008bf782db852e7e Mon Sep 17 00:00:00 2001 From: serega6531 Date: Fri, 10 Apr 2020 18:03:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=20=D1=81=D1=82=D1=80=D0=B8=D0=BC=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D1=85=20=D0=B4=D0=B0?= =?UTF-8?q?=D0=BC=D0=BF=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SidebarStream.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/SidebarStream.vue b/src/components/SidebarStream.vue index 11b12ea..849b148 100644 --- a/src/components/SidebarStream.vue +++ b/src/components/SidebarStream.vue @@ -10,7 +10,7 @@
{{ dateToText(stream.startTimestamp) }}
@@ -45,14 +45,14 @@ }; }, methods: { - dateToText(unixTimestamp) { + dateToText(unixTimestamp, short = false) { const date = new Date(unixTimestamp); const options = { hour: '2-digit', minute: '2-digit', second: '2-digit', }; - if (!this.isToday(date)) { + if (!short && !this.isToday(date)) { options.month = '2-digit'; options.day = '2-digit'; return date.toLocaleDateString('ru-RU', options); @@ -67,6 +67,15 @@ someDate.getFullYear() === today.getFullYear(); }, + dayMatches(rFirst, rSecond) { + const first = new Date(rFirst); + const second = new Date(rSecond); + + return first.getDate() === second.getDate() && + first.getMonth() === second.getMonth() && + first.getFullYear() === second.getFullYear(); + }, + dateMatches(rFirst, rSecond) { const first = new Date(rFirst); const second = new Date(rSecond);