title: Why does jQueryUI datepicker swap day and month on page reload?
body: <p>I have an MVC3 application where one of the pages has a <a href="http://jqueryui.com/datepicker/" rel="nofollow">jQuery datepicker</a>:</p>
  
  <pre><code>&lt;script&gt;
      $(function () {
          $("#expirationDate").datepicker();
          $("#expirationDate").datepicker("option", "dateFormat", "dd/mm/yy");
      });
  &lt;/script&gt;
  
  using (Html.BeginForm())
  {
      @Html.TextBox("expirationDate")
      &lt;input type="submit" value="Submit" /&gt;
  }
  </code></pre>
  
  <p>the controller action goes like this:</p>
  
  <pre><code>public ActionResult DoStuff(String expirationDate)
  {
      return View();
  }
  </code></pre>
  
  <p>The datepicker looks just fine but behaves strangely.</p>
  
  <p>I enter some date into it like for example 31/12/2012 for Dec 31 (note I specified the format to be <code>dd/mm/yy</code>) and press the button. Control goes into the controller and there I see that <code>expirationDate</code> variable holds <code>31/12/2012</code> value. Then the action returns and then I see the textbox being empty.</p>
  
  <p>Then I try 10/12/2012 - it gets into the action but when the page is displayed again it turns into 12/10/2012 - clearly the month and the day are swapped. Perhaps in case of 31/12 it saw that swapping them would yield an invalid date and just discarded that.</p>
  
  <p>Why do day and month get swapped despite the format being explicitly specified?</p>