title: How correctly create string with formatted date?
body: <p>I have such 2 variables:</p>
  
  <pre><code>val dateFrom = "2018-01-15"
  val dateTo = "2018-06-15"
  </code></pre>
  
  <p>How to make such string which has all days between 2 date:</p>
  
  <pre><code>{20180115,20180116,...,20180614,20180615}
  </code></pre>
  
  <p>P.S. As you can see format of date in final result is <code>"yyyyMMdd"</code>.</p>
  
  <p>Thats what I try right now:</p>
  
  <pre><code>import org.joda.time.{DateTime, Days}
  
  def getDaysInBetween(from: DateTime, to: DateTime): Int = Days.daysBetween(from, to).getDays
  
  def getDatesInBetween(from: DateTime, to: DateTime): Seq[DateTime] = {
    val days = getDaysInBetween(from, to)
    (0 to days).map(day =&gt; from.plusDays(day))
  }
  </code></pre>
  
  <p><code>getDatesInBetween</code> function return collection of date in DateTime format.</p>