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 @@