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 period and interval concepts #44

Closed
manuel-woelker opened this issue Aug 21, 2015 · 3 comments
Closed

Add period and interval concepts #44

manuel-woelker opened this issue Aug 21, 2015 · 3 comments

Comments

@manuel-woelker
Copy link

This is a proposal to add period and interval concepts like those used in Joda Time
cf.
http://www.joda.org/joda-time/key_period.html
http://www.joda.org/joda-time/key_interval.html

Those are distinct from but interoperable with the existing duration type, and make it possible to describe operations like "add 1 year to this date" (this might be a different number of seconds depending on the date)

Is this something that you would consider for this library?

@lifthrasiir
Copy link
Contributor

Not an explicit non-goal for Chrono but I wouldn't pursue that neither.

One big reason is that while Chrono closely follows ISO 8601 and other existing practices whenever applicable, there is no particular concensus about the non-regular duration arithmetics (ISO 8601 is a representation standard and does not define, say, the result of 2015-08-24 plus 1 month---it only standardizes that "an interval from 2015-08-24 to 2015-08-24 plus 1 month" can be alternatively written as 2015-08-24/P1M).

Implementing that makes Chrono highly opinionated and I don't think that really justifiable. Such arithmetics should go into a separate library depending on Chrono; I wouldn't object but I don't plan to write one.

@pickfire
Copy link

pickfire commented Jul 5, 2018

@quodlibetor
Copy link
Contributor

Yes it is. I think Intervals will probably be part of the larger iterator story in the upcoming refactor. This is also related to #245

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

4 participants