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

Add localtime function period_exceeds_one_year #41

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

Peter554
Copy link
Contributor

@Peter554 Peter554 commented Feb 27, 2023

Useful for determining whether two datetimes are more than one year apart. Takes into account leap year and DST issues.

Context: In germany an invoice may not legally cover more than one year of consumption. This functionality is needed in a couple of places within germany logic, and can likely be useful for others too. Motivated by https://github.com/octoenergy/kraken-core/pull/72807 and https://github.com/octoenergy/kraken-core/pull/78884.

@Peter554 Peter554 self-assigned this Feb 27, 2023
@Peter554 Peter554 force-pushed the localtime/add-period-exceeds-one-year branch 2 times, most recently from 7fe37ce to 2f69da1 Compare February 27, 2023 17:08
@Peter554 Peter554 marked this pull request as ready for review February 27, 2023 17:15
@Peter554 Peter554 requested a review from laurentputz February 27, 2023 17:15
Copy link
Contributor

@pydanny pydanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, in fact I appreciate how concise and yet well-documented this PR turned out.

Useful for determining whether two datetimes are more than
one year apart. Takes into account leap year and DST issues.

Context: In germany an invoice may not legally cover more
than one year of consumption
@Peter554 Peter554 force-pushed the localtime/add-period-exceeds-one-year branch from 2f69da1 to b26f4cc Compare February 28, 2023 08:52
@Peter554 Peter554 merged commit fb36bb9 into main Feb 28, 2023
@Peter554 Peter554 deleted the localtime/add-period-exceeds-one-year branch February 28, 2023 08:57
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.

2 participants