diff --git a/src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx b/src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx index ff161a4beb..b6538c4f0b 100644 --- a/src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx +++ b/src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx @@ -46,13 +46,10 @@ const formatAmountForExport = ( }; const formatDateRange = (startDate?: DateTime, endDate?: DateTime) => { - if (!startDate) { - startDate = DateTime.local().minus({ months: 1 }).plus({ days: 1 }); - } - if (!endDate) { - endDate = DateTime.local(); - } - return `${startDate.toISODate()}..${endDate.toISODate()}`; + const minDate = + startDate ?? DateTime.local().minus({ months: 1 }).plus({ days: 1 }); + const maxDate = endDate ?? DateTime.local(); + return `${minDate.toISODate()}..${maxDate.toISODate()}`; }; export const AccountTransactions: React.FC = () => {