Fix end of year edge case #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've identified an edge case for constructing m/d/Y dates for transactions.
The year of the statement is determined by a regex on the "Totals Year-to-Date" info box. This year is then used to add a year to all m/d 'Date of Transaction' parsed values.
A statement's transactions spans the second half of the previous month and the first half of the current month. So using the year of the statement is incorrect for the December transactions of January statements.
In this PR, a function to check for December and January transactions and to revise the December transactions' dates in introduced.
An alternate approach to avoiding this issue could be to extract the year from the 'Opening/Closing Date' of the "Account Summary" info box and matching the months of parsed transaction dates, assuming all ingested statements are from the year 2000 on.