title: JqueryUI datepicker returns invalid date on dateFormat
body: <p>I have two datepickers with <code>dateFromat</code> property and I get the following values in debugger:</p>
  
  <p><code>dateText = "27.05.2016"</code></p>
  
  <p><code>begin = Invalid Date {}</code></p>
  
  <p><code>d=NaN</code></p>
  
  <p><code>m=NaN</code> </p>
  
  <p><code>y=NaN</code></p>
  
  <p>Is there a way to get this date format working for my example? I think that the <code>Date()</code> function can't convert to date the value of this date format...</p>
  
  <p>Example without <code>dateFormat</code>: <a href="http://jsbin.com/yuxaliqoba/edit?html,output" rel="nofollow">http://jsbin.com/yuxaliqoba/edit?html,output</a></p>
  
  <p>Example with <code>dateFormat</code>: <a href="http://jsbin.com/hihidihexo/edit?html,output" rel="nofollow">http://jsbin.com/hihidihexo/edit?html,output</a></p>
  
  <pre><code>  &lt;input class="datepicker begin" type="text" /&gt;
    &lt;input class="datepicker end" type="text"/&gt;
    &lt;script&gt;
      $(function () {
          $(".datepicker.begin").datepicker({
              minDate: '+2d',
              maxDate: '+2y',
              dateFormat: 'dd.mm.yy',
              onSelect: function(dateText, inst) {
                 // Resolve the current date
                 var begin = new Date($(this).val());
                 var d = begin.getDate();
                 var m = begin.getMonth();
                 var y = begin.getFullYear();
                 // Update your target date
                 $(".datepicker.end").datepicker('setDate', new Date(y, m, d+2));
                 $(".datepicker.end").datepicker( "option", "minDate",  d - 10);
              }
          });
          $(".datepicker.end").datepicker({
              dateFormat: 'dd.mm.yy',
              minDate: '+4d',
              maxDate: '+2y'
          });
      });
    &lt;/script&gt;
  </code></pre>