Fixed setting ninety days ago to from midnight on so that retrievedTransactionsFromOn gets set correctly -> check in BankingPresenter if all transactions have been fetched also works for this day

This commit is contained in:
dankito 2020-09-22 03:59:59 +02:00
parent 13d95f4bda
commit f96e7a4b30
2 changed files with 2 additions and 3 deletions

View File

@ -345,8 +345,7 @@ open class FinTsClient(
*/
open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
val now = Date()
val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis)
val ninetyDaysAgo = Date(Date.today.millisSinceEpoch - NinetyDaysMillis)
getTransactionsAsync(GetTransactionsParameter(account, account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank) { response ->
callback(response)

View File

@ -131,7 +131,7 @@ open class hbci4jBankingClient(
* or not.
*/
open fun getTransactionsOfLast90Days(bankAccount: TypedBankAccount): GetTransactionsResponse {
val ninetyDaysAgo = Date(Date().time - NinetyDaysInMilliseconds)
val ninetyDaysAgo = Date(Date.today.time - NinetyDaysInMilliseconds)
return getTransactions(GetTransactionsParameter(bankAccount, bankAccount.supportsRetrievingBalance, ninetyDaysAgo)) // TODO: implement abortIfTanIsRequired
}