title: How can i determain if date is between two dates in Scala
body: <p>How can I get date between two dates ?</p>
  
  <p>This is my date: </p>
  
  <pre><code>val date = "01 Jan, 2015"
  </code></pre>
  
  <p>Date range:</p>
  
  <pre><code>val dateFrom = "01 Jan, 1970"
  val dateTill = "01 Jan, 2016"
  </code></pre>
  
  <p>I want to check is my date is between date range.</p>
  
  <p>This is what i have try:</p>
  
  <pre><code>def getLocalDate(date: String): LocalDate = {
  
    LocalDate.parse(date, format.DateTimeFormatter.ofPattern("dd MMM, yyyy"))
  }
  
  def isDateBetWeenRange(from: String, till: String, date: String): Boolean = {
  
    val fromDate = getLocalDate(from)
    val tillDate = getLocalDate(till)
    val myDate = getLocalDate(date)
  
    myDate.isBefore(tillDate) &amp;&amp; myDate.isAfter(fromDate) 
  }
  </code></pre>
  
  <p>But is case the date is same as till date this return false:</p>
  
  <pre><code>val date = "01 Jan, 2010"
  println(isDateBetWeenRange("01 Jan, 2000", "01 Jan, 2016", "01 Jan, date))
  </code></pre>