From 9c96aeae4f21f33488a8bdd7c851bb0164f5ebef Mon Sep 17 00:00:00 2001 From: vikingowl Date: Sun, 14 Nov 2021 13:43:06 +0100 Subject: [PATCH] show if new maps not parsed & new map icon for unparsed matches --- src/utils/DateTime.js | 6 ++++++ src/utils/index.js | 3 ++- src/views/Player.vue | 40 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/utils/DateTime.js b/src/utils/DateTime.js index ec6b146..da9bd09 100644 --- a/src/utils/DateTime.js +++ b/src/utils/DateTime.js @@ -52,3 +52,9 @@ export const FormatVacDate = (date, match) => { return '' } } + +export const MatchNotParsedTime = (match) => { + const matchDate = DateTime.fromSeconds(match || 0) + + return matchDate.diffNow().as('hours') >= -2; +} diff --git a/src/utils/index.js b/src/utils/index.js index 6524065..c55092b 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,4 +1,4 @@ -import {FormatDate, FormatDuration, FormatFullDate, FormatFullDuration, FormatVacDate} from "./DateTime"; +import {FormatDate, FormatDuration, FormatFullDate, FormatFullDuration, FormatVacDate, MatchNotParsedTime} from "./DateTime"; import {GoToLink, GoToMatch, GoToPlayer} from "./GoTo"; import {SaveLastVisitedToLocalStorage} from "./LocalStorage"; import {GetHLTV_1} from "./HLTV"; @@ -19,6 +19,7 @@ import { } from "./Utils"; export { + MatchNotParsedTime, FormatDate, FormatFullDuration, FormatFullDate, diff --git a/src/views/Player.vue b/src/views/Player.vue index ab92fe7..cbacc51 100644 --- a/src/views/Player.vue +++ b/src/views/Player.vue @@ -146,10 +146,14 @@ - + +