Fixed that due to time zone short after midnight calculated day may have been e.g. 30 days + 1 hour -> bank asked for TAN

This commit is contained in:
dankito 2020-04-29 00:53:10 +02:00
parent 56972da14d
commit 977e5101e6
1 changed files with 2 additions and 1 deletions

View File

@ -186,7 +186,8 @@ open class FinTsClient @JvmOverloads constructor(
open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData,
hasRetrievedTransactionsWithTanJustBefore: Boolean): GetTransactionsResponse { hasRetrievedTransactionsWithTanJustBefore: Boolean): GetTransactionsResponse {
val ninetyDaysAgo = Date(Date().time - NinetyDaysAgoMilliseconds) val now = Date()
val ninetyDaysAgo = Date(now.time - NinetyDaysAgoMilliseconds - now.timezoneOffset * 60 * 1000) // map to UTC
val response = getTransactions(GetTransactionsParameter(account.supportsRetrievingBalance, ninetyDaysAgo), bank, customer, account) val response = getTransactions(GetTransactionsParameter(account.supportsRetrievingBalance, ninetyDaysAgo), bank, customer, account)