Skip to content

Commit

Permalink
fix: csvreader: strip before parsing dates
Browse files Browse the repository at this point in the history
  • Loading branch information
redstreet committed Oct 2, 2024
1 parent a9e5323 commit fe279d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beancount_reds_importers/libreader/csvreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def remove_non_numeric(x):

# fixup dates
def convert_date(d):
return datetime.datetime.strptime(d, self.date_format)
"""Remove spaces and convert to datetime"""
return datetime.datetime.strptime(d.strip(), self.date_format)

dates = getattr(self, "date_fields", []) + ["date", "tradeDate", "settleDate"]
for i in dates:
Expand Down

0 comments on commit fe279d0

Please sign in to comment.