Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for valid minimal date when getting transactions #25

Closed
Wizady opened this issue Jan 4, 2022 · 2 comments
Closed

Checking for valid minimal date when getting transactions #25

Wizady opened this issue Jan 4, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Wizady
Copy link

Wizady commented Jan 4, 2022

DKB only allows to get transactions up to three years in the past. If you want to get all your transactions and use e.g. 01.01.1970 as your date_from, setting the from and to fields does not work. The request will therefore return all transactions in the default timeframe (i.e. the last 30 days).

This unwanted effect could be mitigated by adding a feature to validate_dates that not only checks if the dates are not in the future, but also not more than three years in the past:

minimal_date_uts = int(time.mktime(datetime.date.today() - datetime.timedelta(days=3*365).timetuple()))
if date_from_uts < minimal_date_uts:
        date_from = datetime.utcfromtimestamp(minimal_date_uts).strftime('%d.%m.%Y')
if date_to_uts < minimal_date_uts:
        date_to = datetime.utcfromtimestamp(minimal_date_uts).strftime('%d.%m.%Y')
@grindsa grindsa added the enhancement New feature or request label Jan 4, 2022
@grindsa
Copy link
Owner

grindsa commented Jan 4, 2022

Good idea. Let me work on this...

@grindsa
Copy link
Owner

grindsa commented Jan 9, 2022

included in v0.13.1

@grindsa grindsa closed this as completed Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants