mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-23 21:42:06 +00:00
Исправлено отображение времени стрима для старых дампов
This commit is contained in:
parent
4a0cb2c91f
commit
28169642b4
@ -10,7 +10,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
{{ dateToText(stream.startTimestamp) }}
|
{{ dateToText(stream.startTimestamp) }}
|
||||||
<template v-if="!dateMatches(stream.startTimestamp, stream.endTimestamp)">
|
<template v-if="!dateMatches(stream.startTimestamp, stream.endTimestamp)">
|
||||||
- {{ dateToText(stream.endTimestamp) }}
|
- {{ dateToText(stream.endTimestamp, dayMatches(stream.startTimestamp, stream.endTimestamp)) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="stream.userAgentHash"><br/>UA: {{ stream.userAgentHash }}</template>
|
<template v-if="stream.userAgentHash"><br/>UA: {{ stream.userAgentHash }}</template>
|
||||||
<br/>
|
<br/>
|
||||||
@ -45,14 +45,14 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dateToText(unixTimestamp) {
|
dateToText(unixTimestamp, short = false) {
|
||||||
const date = new Date(unixTimestamp);
|
const date = new Date(unixTimestamp);
|
||||||
const options = {
|
const options = {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit',
|
second: '2-digit',
|
||||||
};
|
};
|
||||||
if (!this.isToday(date)) {
|
if (!short && !this.isToday(date)) {
|
||||||
options.month = '2-digit';
|
options.month = '2-digit';
|
||||||
options.day = '2-digit';
|
options.day = '2-digit';
|
||||||
return date.toLocaleDateString('ru-RU', options);
|
return date.toLocaleDateString('ru-RU', options);
|
||||||
@ -67,6 +67,15 @@
|
|||||||
someDate.getFullYear() === today.getFullYear();
|
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) {
|
dateMatches(rFirst, rSecond) {
|
||||||
const first = new Date(rFirst);
|
const first = new Date(rFirst);
|
||||||
const second = new Date(rSecond);
|
const second = new Date(rSecond);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user