Skip to content

Commit 8caf790

Browse files
authored
fix: infinity corrections (#77)
1 parent 31b5f95 commit 8caf790

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ledger/ledger-collection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ export class LedgerCollection implements ILedgerCollection {
262262
const lastMonth = cashFlowItems[cashFlowItems.length - 1].created.getUTCMonth();
263263
const monthsWithData = lastMonth - firstMonth + 1;
264264

265+
if (monthsWithData <= 0) {
266+
return 0;
267+
}
268+
265269
const totalCashFlow = this.getCashFlowQuarter(date);
266270

267271
if (totalCashFlow === 0) {

0 commit comments

Comments
 (0)