Skip to content

Commit

Permalink
Formate the transaction created date withouth timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Aug 14, 2023
1 parent ef12b11 commit b774de1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/TransactionUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Onyx from 'react-native-onyx';
import {format} from 'date-fns';
import lodashGet from 'lodash/get';
import _ from 'underscore';
import CONST from '../CONST';
Expand Down Expand Up @@ -151,9 +152,9 @@ function getCurrency(transaction) {
function getCreated(transaction) {
const created = lodashGet(transaction, 'modifiedCreated', '');
if (created) {
return created;
return format(new Date(created), CONST.DATE.FNS_FORMAT_STRING);
}
return lodashGet(transaction, 'created', '');
return format(new Date(lodashGet(transaction, 'created', '')), CONST.DATE.FNS_FORMAT_STRING)
}

export {buildOptimisticTransaction, getUpdatedTransaction, getTransaction, getDescription, getAmount, getCurrency, getCreated};

0 comments on commit b774de1

Please sign in to comment.