From 1b3367105ed924e6218fd9bfa99beca987e5429c Mon Sep 17 00:00:00 2001 From: Artem Makushov Date: Thu, 19 Oct 2023 16:11:25 +0200 Subject: [PATCH] move to ts --- src/libs/ReportActionsUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 16260e0edea6..f0c1458f04f3 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1,4 +1,4 @@ -import {isEqual, max, parseISO} from 'date-fns'; +import {isEqual, max} from 'date-fns'; import _ from 'lodash'; import lodashFindLast from 'lodash/findLast'; import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; @@ -382,8 +382,8 @@ function getLastVisibleAction(reportID: string, actionsToMerge: ReportActions = if (visibleActions.length === 0) { return null; } - const maxDate = max(visibleActions.map((action) => parseISO(action.created))); - const maxAction = visibleActions.find((action) => isEqual(parseISO(action.created), maxDate)); + const maxDate = max(visibleActions.map((action) => new Date(action.created))); + const maxAction = visibleActions.find((action) => isEqual(new Date(action.created), maxDate)); return maxAction ?? null; }