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

An interval type #37

Open
ariebovenberg opened this issue Feb 4, 2024 · 1 comment
Open

An interval type #37

ariebovenberg opened this issue Feb 4, 2024 · 1 comment
Assignees
Labels
discussion Discussion is needed before proceeding

Comments

@ariebovenberg
Copy link
Owner

Something that's quite common in datetime libraries is an 'interval' type.

It's not the question whether such a thing could be implemented, but whether it is possible to define the 'just right' abstraction that supports the common use cases without being overly complex.

Questions that come to mind:

  • are intervals always closed-open, or are other variants possible?
  • Can intervals only exist of aware types?
@ariebovenberg ariebovenberg added the discussion Discussion is needed before proceeding label Feb 4, 2024
@ariebovenberg ariebovenberg added this to the 1.0 release milestone Mar 13, 2024
@simon04
Copy link

simon04 commented Jul 14, 2024

are intervals always closed-open, or are other variants possible?

Citing from https://www.reddit.com/r/ISO8601/comments/1beahww/intervals/:

ISO 8601-1:2019 states

3.1.1.6 time interval
part of the time axis limited by two instants and, unless otherwise stated, the limiting instants themselves

so it's inclusive-inclusive by default, but it's probably better to specify it yourself because it's not reasonable for someone to expect 12:00/13:00 to be 61 minutes long

@ariebovenberg ariebovenberg self-assigned this Jul 19, 2024
@ariebovenberg ariebovenberg removed this from the API freeze (1.0) milestone Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion is needed before proceeding
Projects
None yet
Development

No branches or pull requests

2 participants