Converted to Scala.
Hooked into the latest Calendar code.