From 8ce9a0b3c9bc96f2fe8da739642f6eef217b1750 Mon Sep 17 00:00:00 2001 From: Aleksander Kantak Date: Mon, 29 Apr 2024 15:14:52 +0200 Subject: [PATCH] fixup! Dates unify (ISO) and logic clean up --- src/etrade_tax_poland/dividends.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/etrade_tax_poland/dividends.py b/src/etrade_tax_poland/dividends.py index 1fc88ed..b9830bc 100644 --- a/src/etrade_tax_poland/dividends.py +++ b/src/etrade_tax_poland/dividends.py @@ -92,8 +92,8 @@ def get_stock_dividend_from_text(text): if "Qualified" in dividend_lines[0]: # latest 2023 doc version - year = year_line.split()[-1] - pay_date = f"{dividend_lines[0].split()[0]}/{year}" + str_date = f"{dividend_lines[0].split()[0]}/{year_line.split()[-1]}" + pay_date = datetime.strptime(str_date, "%m/%d/%Y") gross = dividend_lines[0].split()[-1].replace("$", "") tax = dividend_lines[1].split()[-1][1:-1] net = dividend_lines[2].split()[-1][1:-1]