Category Archives: Scala

Announcing JS.scala v0.1

I’m pleased to announce the initial releas of JS.scala. JS.scala compiles JavaScript source code to Scala source code, allowing you to write your web application entirely in JavaScript! Finally, the expressive power of JavaScript available on the JVM via Scala (some call it “the bytecode of the JVM bytecode”). How does it work? Well, given […]

Scala date range

Google it: “Scala date range”. The results are… unhelpful. The top result (a Stack Overflow link, obviously) hints at a workable solution. Here’s my implementation of it: import org.joda.time.{DateTime, Period} def dateRange(from: DateTime, to: DateTime, step: Period): Iterator[DateTime] = Iterator.iterate(from)(_.plus(step)).takeWhile(!_.isAfter(to)) To use it, provide a “from” date, a “to” date and a joda time period: […]