From 4607f054641c78899fc7fc01bb612fbad04c9d1d Mon Sep 17 00:00:00 2001 From: Mirlan Date: Thu, 3 Jun 2021 19:12:36 +0600 Subject: [PATCH] fix(1168): date creation fix (#376) --- src/features/Matches/helpers/prepareMatches.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/Matches/helpers/prepareMatches.tsx b/src/features/Matches/helpers/prepareMatches.tsx index 87a272a0..fafe5f03 100644 --- a/src/features/Matches/helpers/prepareMatches.tsx +++ b/src/features/Matches/helpers/prepareMatches.tsx @@ -1,5 +1,6 @@ import map from 'lodash/map' +import parse from 'date-fns/parse' import format from 'date-fns/format' import type { Match } from 'requests' @@ -22,7 +23,11 @@ const prepareMatch = (match: Match) => { team2, tournament, } = match - const date = new Date(matchDate) + const date = parse( + matchDate, + 'yyyy-MM-dd HH:mm:ssx', + new Date(), + ) return { access: getMatchAccess(match), calc,