title: Creating a dateRange Scala, Joda, Java
body: <p>I have spent hours trying to make this next piece of code work.</p>
  
  <pre class="lang-scala prettyprint-override"><code>import org.joda.time.{DateTime, Period}
  
  
  def dateRange(from: DateTime, to: DateTime, step: Period): Iterator[DateTime]      =Iterator.iterate(from)(_.plus(step)).takeWhile(!_.isAfter(to))
  
  val range = {
  dateRange(new DateTime(2012, 06, 30).minusYears(5), new DateTime(2000, 06, 30),new Period.months(6))
  }
  </code></pre>
  
  <p>I'm trying to set up a date range array that steps through from 2000 to 2012 in 6 month increments. The problem that I am facing is the following error.</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: No instant converter found for type: scala.Tuple3
  at    org.joda.time.convert.ConverterManager.getInstantConverter(ConverterManager.java:165)
  at org.joda.time.base.BaseDateTime.&lt;init&gt;(BaseDateTime.java:169)
  at org.joda.time.DateTime.&lt;init&gt;(DateTime.java:241)
  at tester.MomentumAlgo$class.$init$(MomentumAlgo.scala:154)
  at tester.RunMomentumAlgo$$anon$1.&lt;init&gt;(RunMomentumAlgo.scala:86)
  at tester.RunMomentumAlgo$.main(RunMomentumAlgo.scala:86)
  at tester.RunMomentumAlgo.main(RunMomentumAlgo.scala)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:601)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  </code></pre>
  
  <p>I seems to be something to do with the last Period.months() part, however I have no idea how to fix it. The Tuple3 error I have no idea about.</p>
  
  <p>If someone can give me a different solution, that would also be great. I want a list of dates from 2000 to 2012, every 6 months.</p>
  
  <p>Any questions welcome. I thought this would be a common piece of code, but there isn't much on the net about it.</p>
  
  <p>Thanks in advance.</p>