Skip to content

Instantly share code, notes, and snippets.

@ryoppy
Created September 17, 2014 13:07
Show Gist options
  • Save ryoppy/a996d3c9438d7717f9a4 to your computer and use it in GitHub Desktop.
Save ryoppy/a996d3c9438d7717f9a4 to your computer and use it in GitHub Desktop.
def interval2seq(in: Interval): Seq[DateTime] = {
@tailrec
def f(t: DateTime, acum: Seq[DateTime]): Seq[DateTime] = if (in.contains(t)) f(d.plusDay(1), t +: acum) else acum.reverse
f(in.start, Nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment