title: How to do strict LocalDate parsing in js-joda?
body: <p>I'm trying to parse a <a href="https://doc.esdoc.org/github.com/js-joda/js-joda/class/src/LocalDate.js~LocalDate.html" rel="nofollow"><code>LocalDate</code></a> from a <code>String</code> using strict resolution in <a href="http://js-joda.github.io/js-joda/" rel="nofollow"><code>js-joda</code></a> (version 1.1.1). I don't want to accept inputs that aren't valid dates, like <code>2016-05-32</code>. But I just don't get it.</p>
  
  <p>My code is:</p>
  
  <pre><code>formatter = (new JSJoda.DateTimeFormatterBuilder)
      .appendPattern("yyyy-MM-dd")
      .toFormatter(JSJoda.ResolverStyle.STRICT);
  
  JSJoda.LocalDate.parse("2016-05-10", formatter);
  </code></pre>
  
  <p>and the error:</p>
  
  <pre><code>Text '2016-05-10' could not be parsed: Unable to obtain LocalDate from
  TemporalAccessor: [object Object], type DateTimeBuilder: 2016-05-10,
  at index: 0
  </code></pre>
  
  <p>The same code with <code>ResolverStyle.LENIENT</code> or <code>ResolverStyle.SMART</code> works as it's expected for this modes.</p>
  
  <pre><code>formatter = (new JSJoda.DateTimeFormatterBuilder)
      .appendPattern("yyyy-MM-dd")
      .toFormatter(JSJoda.ResolverStyle.LENIENT);
  
  JSJoda.LocalDate.parse("2016-05-32", formatter); // result 2016-06-01
  </code></pre>
  
  <p>How can I use strict resolution in <a href="http://js-joda.github.io/js-joda/" rel="nofollow"><code>js-joda</code></a>?</p>
  
  <p><a href="https://tonicdev.com/5730e524abbf001200bb88da/5730e573abbf001200bb88ee" rel="nofollow">JS Demo</a></p>
  
  <p><em>Update</em>: </p>
  
  <p>However the <a href="https://doc.esdoc.org/github.com/js-joda/js-joda/class/src/format/DateTimeFormatter.js~DateTimeFormatter.html#static-method-ofPattern" rel="nofollow">js-joda DateTimeFormatter API</a> does not mention this option, the pattern <code>uuuu-MM-dd</code> proposed by @JodaStephen works fine. <a href="https://tonicdev.com/5731b4c2ac945f1100995d56/5731b4c2ac945f1100995d57" rel="nofollow">Working Js Demo</a> </p>
  
  <p><a href="https://doc.esdoc.org/github.com/js-joda/js-joda/class/src/format/DateTimeFormatter.js~DateTimeFormatter.html#static-method-ofPattern" rel="nofollow">js-joda api</a>:</p>
  
  <pre>
   |Symbol  |Meaning                     |Presentation      |Examples
   |--------|----------------------------|------------------|---------------
   | G      | era                        | number/text      | 1; 01; AD; Anno Domini
   | y      | year                       | year             | 2004; 04
   | D      | day-of-year                | number           | 189
   | M      | month-of-year              | number/text      | 7; 07; Jul; July; J
  </pre>
  
  <p><a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html" rel="nofollow">Java api</a>:</p>
  
  <pre>
   Symbol  Meaning                     Presentation      Examples
    ------  -------                     ------------      -------
     G       era                         text              AD; Anno Domini; A
     u       year                        year              2004; 04
     y       year-of-era                 year              2004; 04
     D       day-of-year                 number            189
  </pre>