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

Fixup transaction dates with February 30 #22

Merged
merged 1 commit into from
Apr 25, 2016

Conversation

sebschrader
Copy link
Contributor

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.

German banks use a variant of the 30/360 interest rate calculation system,
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.

A statement pre-processor is added 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).
@wolph wolph merged commit ba90cd1 into wolph:develop Apr 25, 2016
@wolph
Copy link
Owner

wolph commented Apr 25, 2016

Hi Sebastian,

The test directories are simply tests copied from other parsers so I could be sure that all code is tested as well as possible. The local tests are simply outside of that.

Thanks for the patch, looks really great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants