Transaction View: LastMonth calculation fixed

This commit is contained in:
crowning- 2016-01-11 21:49:42 +01:00 committed by Holger Schinzel
parent 073d1326ba
commit 1e59cf0ceb

View File

@ -280,9 +280,16 @@ void TransactionView::chooseDate(int idx)
TransactionFilterProxy::MAX_DATE);
break;
case LastMonth:
if (current.month() == 1){
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year()-1, 12, 1)),
QDateTime(QDate(current.year(), current.month(), 1)));
}
else {
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), current.month()-1, 1)),
QDateTime(QDate(current.year(), current.month(), 1)));
}
break;
case ThisYear:
transactionProxyModel->setDateRange(