Skip to content

Commit

Permalink
Merge pull request #41590 from Expensify/cmartins-sortByDate
Browse files Browse the repository at this point in the history
Add simple sorting
  • Loading branch information
luacmartins authored May 3, 2024
2 parents aa9c279 + 7627545 commit c234678
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/SearchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function getTransactionsSections(data: OnyxTypes.SearchResults['data']): SearchT
shouldShowMerchant,
keyForList: value.transactionID,
};
})
.sort((a, b) => {
const createdA = a.modifiedCreated ? a.modifiedCreated : a.created;
const createdB = b.modifiedCreated ? b.modifiedCreated : b.created;
return createdB > createdA ? 1 : -1;
});
}

Expand Down

0 comments on commit c234678

Please sign in to comment.