From f96e7a4b30b0ea51fe4f041c458dc2229d3617bc Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 22 Sep 2020 03:59:59 +0200 Subject: [PATCH] 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 --- .../commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt | 3 +-- .../src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 099ba746..804da5aa 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -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) diff --git a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt index 570a9f20..587a4f1b 100644 --- a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt +++ b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt @@ -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 }