title: Working with Date and LocalDate
body: <p>I want to use an array of <code>data class</code> where one of the parameters is <code>Date</code>, I could not use <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/-date/index.html" rel="nofollow noreferrer">Date()</a> as it looks to be related to <code>KotlinJS</code>, so I tried using <code>LocalDate</code> so I wrote the below code:</p>
  
  <pre><code>import java.time.LocalDate
  import java.time.format.DateTimeFormatter
  import java.util.*
  
  data class transaction (var date: LocalDate, var quantity: Double)
  val formatter: DateTimeFormatter
      get() = DateTimeFormatter.ofPattern("dd.mm.yyyy", Locale.ENGLISH)
  
  fun main(args: Array&lt;String&gt;) {
      var salesOrders = ArrayList&lt;transaction&gt;()
  
      println("Hello, world! ")
  
      salesOrders.set(0, transaction(LocalDate.parse("01.02.2018", formatter), 0.0))
  
  
      println(salesOrders)
  
  }
  </code></pre>
  
  <p>But, as shown at <a href="https://try.kotlinlang.org/#/UserProjects/71gmdrahfvj03mgcf59chfs0nq/5n5qtiv8o4u3b2eq0lt5kn6qi7" rel="nofollow noreferrer">tryKotlin</a> I'm getting an error, that:</p>
  
  <blockquote>
    <p>Text '01.02.2018' could not be parsed: Unable to obtain LocalDate from TemporalAccessor: {Year=2018, MinuteOfHour=2, DayOfMonth=1}.</p>
  </blockquote>