Fixup transaction dates with February 30 #22
Merged
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.
Hi,
I've encountered a very strange problem with statements of my bank. Some transactions were dated on February 30.
As it turns out, German banks use a variant of the 30/360 interest rate calculation system (see here if interested, where each month has exactly 30 days. This can lead to transactions that are dated on February 30, which are not accepted by many date handling software, such as Python's datetime module.
I've added a statement pre-processor which sets the date of transactions with an original date of February 30 to the last day of February (February 28 or February 29 depending on leap years).
I was not sure in which directory new test statements should be placed, so I created a new one. There are already three directories (betterplace, cmxl and jejik) with test statements, but these seem to be based on other mt940 libraries.