Skip to content

InstantRange #368

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

Closed
mgroth0 opened this issue Mar 17, 2024 · 1 comment
Closed

InstantRange #368

mgroth0 opened this issue Mar 17, 2024 · 1 comment

Comments

@mgroth0
Copy link

mgroth0 commented Mar 17, 2024

I am curious if it would be beneficial for this library to establish a standardized class encapsualting two instants.

I cannot currently think of a great name. InstantRange is accurate, but sounds strange. Other candidates are:

  • TimePeriod
  • Period
  • InstantPeriod
  • TImeRange

You get the picture.

The class would essentially be:

@Serializable
data class Period(val start: Instant, val end: Instant) {
    init { require(end > start) }
    val duration by lazy { end - start }
}
@dkhalanskyjb
Copy link
Collaborator

Duplicate of #34
If you have specific use cases, please describe them there.

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