-
Notifications
You must be signed in to change notification settings - Fork 79
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 method to convert an interval into a collection #78
Comments
I have been doing something like this, too: implicit class RichInterval(self: Interval) {
import org.joda.time.ReadablePeriod
def by(d: ReadablePeriod) = {
val coll = collection.mutable.ListBuffer[DateTime]()
var x = self.start
while (x < self.end) {
coll += x
x += d
}
coll.toList
}
} |
I'd be glad to provide a PR on this. Maybe we can even take a builder or so and make it: def by[Coll](...)(implicit ...): Coll[DateTime] = ??? ... like the |
Merged
cool 👍 |
xuwei-k
added a commit
that referenced
this issue
Nov 27, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it would be useful to have a method to convert an interval to immutable collection of dates, like SortedSet, with specified step. The main goal is to be able to utilize Scala collections API out of the box
The text was updated successfully, but these errors were encountered: