Skip to content

Commit

Permalink
move to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
waterim committed Oct 19, 2023
1 parent b1ae0c2 commit 1b33671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1b33671

Please sign in to comment.