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 org.threeten.extra LocalDateRange? #25

Open
jdf-id-au opened this issue Sep 30, 2018 · 1 comment
Open

Support org.threeten.extra LocalDateRange? #25

jdf-id-au opened this issue Sep 30, 2018 · 1 comment

Comments

@jdf-id-au
Copy link

Thanks for an elegant wrapper.

I currently have to drop into interop to make a LocalDateRange from org.threeten.extra. Do you have any plans to bring it in? I note you already support Interval from that library.

Can I help? I might need you to point me in the right direction to get started.

@dm3
Copy link
Owner

dm3 commented Sep 30, 2018

Sure, you can look in the src/java_time/interval.clj to see how the Interval is integrated. A range is different from interval as it doesn't capture a continuous stretch of time. I don't think there's an entity like that currently implemented in this library.

Do you need the LocalDateRange for the sake of Java interop or do you want to express a domain concern in Clojure? The reason I'm asking is that I usually use a Clojure sequence to get a range of dates like so:

user=> (take 3 (j/iterate j/plus (j/local-date) (j/days 1)))
(#object[java.time.LocalDate 0x1dc677bd "2018-09-30"]
 #object[java.time.LocalDate 0x367215e9 "2018-10-01"]
 #object[java.time.LocalDate 0x31e9a042 "2018-10-02"])

then you have your normal sequence transformations to get whichever info is needed. I guess it would still be useful to have some higher level range-specific operations implemented, like intersection, comparison, etc. as well as maintaining the Seq interface to allow direct iteration. Also, having a generic interface suitable for minutes/hours/local dates/etc. would probably make sense - what do you think?

@dm3 dm3 added enhancement community Waiting for community input help wanted and removed community Waiting for community input labels Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants