Skip to content

Instantly share code, notes, and snippets.

@wfaler
Created February 10, 2012 18:22
Show Gist options
  • Select an option

  • Save wfaler/1791448 to your computer and use it in GitHub Desktop.

Select an option

Save wfaler/1791448 to your computer and use it in GitHub Desktop.
continuous timeline to list of days
lazy val tradingDays: List[List[Price]] = prices.groupBy(price => {
Days.daysBetween(price.dateTime, prices.last.dateTime)
}).values.toList.sortWith((a,b) => a.head.dateTime.isBefore(b.head.dateTime))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment