Skip to content

Commit ffa7b08

Browse files
committed
Verify if the date is valid
Signed-off-by: Pierre Michel <pmiche04@gmail.com>
1 parent 62fe310 commit ffa7b08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libs/TransactionUtils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Onyx from 'react-native-onyx';
2-
import {format, parseISO} from 'date-fns';
2+
import {format, parseISO, isValid} from 'date-fns';
33
import lodashGet from 'lodash/get';
44
import _ from 'underscore';
55
import CONST from '../CONST';
@@ -176,7 +176,7 @@ function getCurrency(transaction) {
176176
function getCreated(transaction) {
177177
const created = lodashGet(transaction, 'modifiedCreated', '') || lodashGet(transaction, 'created', '');
178178
const createdDate = parseISO(created);
179-
if (createdDate) {
179+
if (isValid(createdDate)) {
180180
return format(createdDate, CONST.DATE.FNS_FORMAT_STRING);
181181
}
182182

0 commit comments

Comments
 (0)