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

Adds Year and Month support to Duration #53

Merged
merged 4 commits into from
Jun 28, 2024
Merged

Adds Year and Month support to Duration #53

merged 4 commits into from
Jun 28, 2024

Conversation

nickybulthuis
Copy link
Contributor

We need support for durations specified in Years and Months. Currently, the implementation supports durations up to days. This PR adds Year and Month support as shown below:

Odata SQL
period_start add duration'P1Y' ge period_end "period_start" + INTERVAL '1' YEAR >= "period_end"
period_start add duration'P2M' ge period_end "period_start" + INTERVAL '2' MONTH >= "period_end"

SQLAlchemy and Django use timedelta, which doesn't support durations larger than days. I've used average days for a year (365.25) and a month (30.44). This isn't entirely accurate but might be sufficient.

@OliverHofkens OliverHofkens self-assigned this Jun 28, 2024
@OliverHofkens OliverHofkens self-requested a review June 28, 2024 11:24
@OliverHofkens OliverHofkens added the enhancement New feature or request label Jun 28, 2024
@OliverHofkens
Copy link
Member

Hmm, tests are failing due to something unrelated. Don't worry about it.

Looks good to me, thank you for your contribution! I have some CI stuff to clean up before making a new release, but I'll try to do so Soon ™️ .

@OliverHofkens OliverHofkens merged commit c0b5bb2 into gorilla-co:master Jun 28, 2024
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants