Skip to content

Instantly share code, notes, and snippets.

@ayax79
Created December 2, 2011 21:20
Show Gist options
  • Select an option

  • Save ayax79/1424878 to your computer and use it in GitHub Desktop.

Select an option

Save ayax79/1424878 to your computer and use it in GitHub Desktop.
private def latestActivity(l: Location): Option[DateTime] = {
val journals = l.workflows().map(wf => WorkflowJournal().workflow(wf).lookfor()).filter(_.isDefined).map(_.get)
val sortedDates = journals.map(_.modifiedTimestamp()).sortWith(_.compareTo(_) > 0) // this should make it reversed
if (!sortedDates.isEmpty) Some(sortedDates.head)
else None
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment