Fix: Passt an, dass bei monatlichen Transaktionen der Tag entsprechend hergenommen wird
This commit is contained in:
@@ -67,15 +67,51 @@ class GenerateTransactionsTask extends Task {
|
||||
case TimeFrameEnum.weekly:
|
||||
newTransactionDate = lastTransactionDate.add(const Duration(days: 7));
|
||||
case TimeFrameEnum.monthly:
|
||||
newTransactionDate = DateUtils.addMonthsToMonthDate(
|
||||
final DateTime monthDate = DateUtils.addMonthsToMonthDate(
|
||||
lastTransactionDate,
|
||||
1,
|
||||
);
|
||||
|
||||
final int day =
|
||||
recurringTransaction.startDate!.day <
|
||||
DateUtils.getDaysInMonth(
|
||||
monthDate.year,
|
||||
monthDate.day,
|
||||
)
|
||||
? recurringTransaction.startDate!.day
|
||||
: DateUtils.getDaysInMonth(
|
||||
monthDate.year,
|
||||
monthDate.month,
|
||||
);
|
||||
|
||||
newTransactionDate = DateTime(
|
||||
monthDate.year,
|
||||
monthDate.month,
|
||||
day,
|
||||
);
|
||||
case TimeFrameEnum.yearly:
|
||||
newTransactionDate = DateUtils.addMonthsToMonthDate(
|
||||
final DateTime monthDate = DateUtils.addMonthsToMonthDate(
|
||||
lastTransactionDate,
|
||||
12,
|
||||
);
|
||||
|
||||
final int day =
|
||||
recurringTransaction.startDate!.day <
|
||||
DateUtils.getDaysInMonth(
|
||||
monthDate.year,
|
||||
monthDate.day,
|
||||
)
|
||||
? recurringTransaction.startDate!.day
|
||||
: DateUtils.getDaysInMonth(
|
||||
monthDate.year,
|
||||
monthDate.month,
|
||||
);
|
||||
|
||||
newTransactionDate = DateTime(
|
||||
monthDate.year,
|
||||
monthDate.month,
|
||||
day,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
newTransactionDate = recurringTransaction.startDate!;
|
||||
|
||||
Reference in New Issue
Block a user