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

Support Elixir built in Duration struct #908

Open
josevalim opened this issue May 15, 2024 · 1 comment
Open

Support Elixir built in Duration struct #908

josevalim opened this issue May 15, 2024 · 1 comment

Comments

@josevalim
Copy link
Member

josevalim commented May 15, 2024

It will have loss of precision similar to other Calendar types when converted back but one can always cast to integer before/after for full precision. We should also raise if the duration has month or year set.

We need to wait until v1.17.

@billylanchantin
Copy link
Contributor

@josevalim This would be great!

I was actually looking into a similar thing the other day. Polars supports calendar math:

This differs from pl.col("foo") + timedelta in that it can take months and leap years into account.

Our %Explorer.Duration{} is equivalent to Python's timedelta. We may want to consider adding offset_by support when we add Elixir's Duration if it supports calendar math too.

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

No branches or pull requests

2 participants